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, range sliders, and a map location picker.
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.
For places: Location Picker is a map you drag under a fixed pin that lifts while the map moves and drops when it settles, then looks up the address with stale answers cancelled and recent ones cached. It uses MapKit's reverse geocoding on iOS 26 with a fallback before it, and asks for location only when the locate button is tapped.
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 make a map location picker in SwiftUI?
Keep a pin fixed over the centre of a Map, follow the camera with onMapCameraChange, and look up the address only after the camera settles, cancelling any lookup a newer move replaces. Location Picker does this with a lifting pin, a cached geocoder and an address card with loading and failure states.
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 controls7Buttons and dials with press depth, hold, drag and outcome states.
- Sheets5Toasts, confirmations, permission moments and guided tours.
- Lists7Rows, grids and carousels with swipe, drag-to-select, follow-the-latest and completion physics.
- Text4Type that reveals, expands, holds pictures and renders as glass.
- Backgrounds2Quiet atmospheres: a Metal silk shader and a touch-reactive dot grid.
- Liquid Glass5Correct iOS 26 Liquid Glass with Material fallbacks.
- Cards5Cards with depth, motion, parallax and gesture-driven stacks.
- Navigation7Floating docks, tracking tabs, stretchy headers and an A to Z index.
- Feedback5Reactions, ratings, status morphs, skeletons and outcomes.
- Motion1Gesture modifiers with real physics.
- Data and charts6Scrubbable charts, rings, streak heatmaps, live stats and odometers.
- AI6Streaming replies, thinking states, prompt chips and answer sources.
- Media8Photo viewing and cropping, story playback, attachments and link previews.
- Animations16Springs, gesture physics, transitions and morphs, across every category.
- Haptics33Pieces that tick, tap and confirm at the moment that matters.
Ready to build something better?
85 pieces, one file each, yours to keep. Start with the library or see what the whole app looks like.