SwiftUI input fields and form controls
The inputs SwiftUI still leaves hard: a floating-label text field with validation, a password strength field, currency and token fields, a date range picker, and range sliders.
About these pieces
One self-contained Swift file each, Apple frameworks only, from iOS 17.
Form Field is a text field whose label rests inside as a placeholder and glides up on focus, with a character limit, help text and validation that waits until you leave the field before it shows an error. Secure Entry adds a reveal toggle, a four-step strength bar and requirement chips. Amount Field formats currency live in the user's locale on a Decimal binding. Token Field turns entries into wrapping chips for tags and recipients, with paste of a whole list and inline suggestions.
For picking values: Range Slider is a dual-thumb slider whose thumbs never cross, Expanding Track is a thumbless slider that swells under the finger, Scrub Stepper steps by tap, hold or a sideways scrub, Date Range Picker selects a start and end date on a paged month grid, and Filter Rail is a scrolling row of filter chips.
Learn the technique: SwiftUI haptics guide.
Questions
How the pieces work, and how to build the same thing yourself. Every piece's page has its full notes.
Does SwiftUI have a range slider with two thumbs?
No. SwiftUI's Slider has one thumb. Range Slider adds a dual-thumb control with step snapping, a minimum gap, thumbs that never cross, and a haptic on every step.
How do I make a floating label text field in SwiftUI?
Overlay the label on the field and move and scale it up when the field is focused or has text, driven by @FocusState. Form Field does this and adds validation, a character counter and VoiceOver announcements.
How do I format currency input in SwiftUI?
Keep the value as a Decimal and format it with the user's locale as digits arrive, rather than binding a TextField to a formatted string. Amount Field handles grouping, the decimal separator, symbol position and pasted amounts.
Keep browsing
Nearby collections, then every category in the library.
- Buttons and controlsButtons and dials with press depth, hold, drag and outcome states.5
- SheetsToasts, confirmations and permission moments.3
- ListsRows and carousels with swipe, depth and completion physics.5
- TextType that reveals, expands and renders as glass.3
- BackgroundsQuiet atmospheres: a Metal silk shader and a touch-reactive dot grid.2
- Liquid GlassCorrect iOS 26 Liquid Glass with Material fallbacks.3
- CardsCards with depth, motion, parallax and gesture-driven stacks.4
- NavigationFloating docks, tracking tabs and stretchy headers.3
- FeedbackReactions, ratings, status morphs, skeletons and outcomes.5
- MotionGesture modifiers with real physics.1
- Data and chartsScrubbable charts, rings, live stats and odometers.4
- AIStreaming replies, thinking states, prompt chips and code.6
- MediaPhoto viewing and story playback.2
- AnimationsSprings, gesture physics, transitions and morphs, across every category.16
- HapticsPieces that tick, tap and confirm at the moment that matters.19
Ready to build something better?
55 pieces, one file each, yours to keep. Start with the library or see what the whole app looks like.