Dropdown
A field that opens its options in an anchored popover or a sheet, with a gliding highlight, drawn checks, a rolling value, hold-drag-release and swipe to cycle.
npx @swipeui/cli add dropdownWhen to use it
- Choosing one option from a list too long for radio buttons, such as a country, language or time zone.
- Form fields that should look like the other fields (filled, with a ring while open) and open a short list right under them.
- Long or searchable lists, which open in a sheet with room to scroll and a search field.
- Quick changes on a phone: hold the field, drag to an option and let go; or swipe the field to step through options.
When not to use it
- Two to five options that should stay visible. Use Radio group or Segmented control.
- Several choices at once. Use Multi-select.
- Search as the main task, with typing in the field itself. Use Combobox.
- Dates and times. Use Date picker or Time picker.
Installation
Run this from your app's root. If SwipeUI isn't set up yet, run npx @swipeui/cli init first; it sets up Uniwind, the theme tokens and the cn helper.
npx @swipeui/cli add dropdown- Adds
components/swipeui/ui/dropdown.tsx,components/swipeui/ui/use-dropdown.tsand 20 shared helpers. - Installs react-native-gesture-handler, react-native-reanimated, react-native-worklets, clsx, tailwind-merge, uniwind, expo-haptics, class-variance-authority, react-native-svg, react-native-safe-area-context, @expo/ui, @gorhom/bottom-sheet, expo-blur. In Expo apps it uses
npx expo installso versions match your SDK.
Usage
import { Dropdown } from '@/components/swipeui/ui/dropdown';
<Dropdown
label="Country or region"
options={[
{ value: 'pt', label: 'Portugal' },
{ value: 'jp', label: 'Japan' },
{ value: 'ca', label: 'Canada' },
]}
defaultValue="pt"
/>;Popovers render in the overlay layer, so put OverlayProvider near the app root (sheets need SheetProvider).
Examples
Grouped options with icons and a trailing detail. Ten options open in a sheet; seven or fewer open in a popover under the field:
<Dropdown
label="Time zone"
groups={[
{ key: 'europe', label: 'Europe' },
{ key: 'americas', label: 'Americas' },
]}
options={[
{ value: 'lis', label: 'Lisbon', detail: 'UTC+0', group: 'europe' },
{ value: 'nyc', label: 'New York', detail: 'UTC−5', group: 'americas' },
]}
/>An option that can't be chosen says why, and the reason is spoken as its hint:
{ value: 'xl', label: 'Extra large', disabled: true, disabledReason: 'Sold out' }Step through options with a sideways swipe on the closed field, and clear the value:
<Dropdown label="Playback speed" options={speeds} swipeToCycle clearable />API reference
DropdownProps
| Prop | Type | Default | Description |
|---|---|---|---|
label | | — | The visible and spoken name. An empty string hides it visually. |
options | | — | The options, in order. Group them with |
groups? | | — | Group headings, in order. Options name them through |
value? | | — | The chosen value (controlled); |
defaultValue? | | | The value it starts with (uncontrolled). |
onValueChange? | | — | Reports a new value, or |
placeholder? | | | Shown, muted, when nothing is chosen. |
presentation? | | |
|
variant? | | | 1.x look: |
searchable? | | | A search field above the options. Search needs the keyboard, so it implies a sheet. |
clearable? | | | A clear button inside the field while a value is chosen. |
pressDragRelease? | | | ★ Hold the field to open the popover, drag over the rows (a tick each) and release to pick. Popover only. |
holdDelay? | | | How long the finger rests before the list opens, in milliseconds (content timing). |
swipeToCycle? | | | ★ Swipe the closed field sideways to step to the next or previous option. Screen readers get Next and Previous actions. |
typeahead? | | | On the web, typing letters on the field or in the list jumps to the next matching option. |
rollValue? | | | The value rolls up for a later option and down for an earlier one. |
highlight? | | | One highlight glides to the chosen row and follows a drag; |
maxListHeight? | | | The popover's tallest height before it scrolls, in points. |
helper? | | — | Supporting text under the field. |
error? | | — | Validation message. A new one shakes the field once and plays an error haptic. |
success? | | — | Confirmation text; replaces the helper. |
status? | | | Validation state shown on the field. |
required? | | | Marks the field required; "Required" is spoken. |
requiredIndicator? | | | How a required field is marked. |
optionalIndicator? | | | Show "Optional" after the label. |
disabled? | | | Prevents opening, picking, swiping and clearing. |
disabledStyle? | | |
|
appearance? | | | The field's surface. |
size? | | |
|
shape? | | |
|
labelPlacement? | | | Where the label sits: above, inside at the top ( |
focusRing? | | | The ring and halo shown while the list is open. |
leadingIcon? | | — | A leading icon in the field: a node, or a function given the state colour and size. |
messages? | | | Built-in strings, for translation. |
haptics? | | | Haptics: a switch, or per part ( |
motion? | | | Field, list, highlight and value motion. |
className? | | — | Classes on the field. |
style? | | — | Field style. |
testID? | | — | The trigger's identifier. The list appends |
Options are SelectionOptions from selection-core: value, label, description, detail, icon, keywords, disabled, disabledReason, group and badge.
Composition and behavior
- The trigger is a field: filled by default, the value at the start, a muted placeholder, an optional leading icon (a chosen option's icon replaces it), and a chevron that turns while the list is open, with the focus ring.
- presentation
autoanchors a popover under the field, at its width, for 7 options or fewer; longer lists and searchable ones open in a sheet. The popover scrolls past maxListHeight. - Choosing an option glides the highlight to it and draws its check on, then closes the list. The value rolls up for a later option and down for an earlier one (rollValue). Focus moves to the chosen row on open and back to the field on close.
- ★ Hold the field for holdDelay, drag over the rows (a tick for each) and let go to pick. Lifting away after dragging cancels; lifting without reaching a row leaves the list open for taps. Popover only.
- ★ swipeToCycle steps to the next option when you swipe toward the start edge and the previous one toward the end, mirrored in right-to-left layouts, skipping disabled options. Screen readers get Next option and Previous option actions instead.
- On the web: arrows open the list; in it, arrows, Home/End and PageUp/PageDown move, Enter chooses, letters jump and Escape closes. Letters on the closed field pick the next match (typeahead).
- Renamed from Select:
<Select>still works as an alias of<Dropdown>. - Select 1.x:
variant="sheet"means a sheet andvariant="morph"renders Morph select; for the 1.x look passpresentation="sheet".
Dropdown settings
| Prop | Does | Default |
|---|---|---|
| presentation | auto, popover or sheet | auto |
| searchable | A search field; always a sheet | false |
| clearable | A clear button while a value is chosen | false |
| pressDragRelease / holdDelay | ★ Hold, drag and release to pick (ms to hold) | true, 350 |
| swipeToCycle | ★ Swipe the closed field to step | false |
| typeahead | Letters jump to matches on the web | true |
| rollValue | The value rolls in the direction of travel | true |
| highlight | glide or none | glide |
| maxListHeight | The popover's height before it scrolls (pt) | 320 |
| groups | Group headings, in order | none |
| appearance / size / shape | Field look: filled…, sm/md/lg, preset/pill | filled, md, preset |
| labelPlacement | above, inset or hidden | above |
| leadingIcon | A node, or a function given { color, size } | none |
| helper / error / success | Messages under the field | none |
| required / disabled | Required mark; no opening, swiping or clearing | false |
| haptics | All, or { select, limit, clear } | select, limit |
| messages | Built-in strings, for translation | English |
| motion | A local motion feel or override | the app's feel |
Behavior and gestures
- Tap the field to open the options: anchored under it for 7 or fewer (`presentation="auto"`), in a sheet for more or with `searchable`.
- Tap an option to choose it: the highlight glides there, its check draws on, the list closes and the value rolls up (a later option) or down (an earlier one).
- ★ Hold the field (350 ms, `holdDelay`), drag over the rows with a tick each and release to pick. Lifting away after dragging cancels; lifting without reaching a row leaves the list open for taps (`pressDragRelease`).
- ★ With `swipeToCycle`, swipe the closed field sideways to step to the next or previous enabled option; the ends answer with a warning tick.
- With `clearable`, a clear button inside the field empties it.
- On the web, arrows open the list; in it, arrows, Home/End and PageUp/PageDown move, Enter chooses, letters jump and Escape closes. Letters on the closed field pick the next match (`typeahead`).
Accessibility
- The field is a button named "Label: value" (or the placeholder) that reports expanded; helper or error text is its hint, plus a swipe hint with `swipeToCycle`.
- Rows are radios with checked state; a disabled row speaks its `disabledReason` (or Unavailable) as the hint. Group headings are headers.
- Focus moves to the chosen row when the list opens and back to the field when it closes.
- Every gesture has a tap path: tap to open and tap to pick; `swipeToCycle` adds Next option and Previous option actions. Picks made without opening the list are announced once.
Motion
- Uses the
select,toggle,morph,overlay,dragandpressmotion roles, so it follows your app's feel. Passmotionto tune this one instance. - The ring and chevron turn on the toggle role; the popover and sheet open on the overlay role.
- The highlight glides between rows on the select spring and snaps on a layout change; checks draw on the toggle role.
- The value rolls 8pt up or down in the direction of travel on the morph role, and a new error shakes the field once.
- While held open the popover appears at once, so the rows sit still under the finger.
- Reduce Motion: the value fades, the highlight jumps, checks fade in without drawing, and the shake goes; haptics stay.
Performance
- The popover renders plain rows (no nested virtualised list). Gesture state stays on the UI thread with one tick per row crossed.
- Search filters locally with accent folding; nothing is sent anywhere.
Notes for AI
- Give options unique values; `null` means nothing chosen. Options are `SelectionOption`s from selection-core (icon, detail, group, keywords, disabledReason, badge).
- Popovers need `OverlayProvider` at the app root; sheets need `SheetProvider`.
- Select 1.x `variant="sheet"` means `presentation="sheet"`; `variant="morph"` renders Morph select.
- Renamed from Select (2026-11-08): install `dropdown`; `Select`, `SelectProps` and `SelectOption` stay exported as aliases.
Compatibility
| Runs on | Supported |
|---|---|
| Expo SDK 57 | Yes |
| Expo SDK 58 | Yes |
| React Native CLI (with Expo modules) | Yes |
| Expo Go | Yes |
| iOS | Yes |
| Android | Yes |
This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.