SwipeUI

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 dropdown
Variant
Preset
Material
Scheme
Feel
Real free component with a browser animation bridge. Native motion, haptics and materials need a device.

When 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.ts and 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 install so versions match your SDK.

Usage

app/profile.tsx
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

PropTypeDefaultDescription
labelstring—

The visible and spoken name. An empty string hides it visually.

optionsreadonly DropdownOption<T>[]—

The options, in order. Group them with group and groups.

groups?readonly SelectionGroup[]—

Group headings, in order. Options name them through group.

value?T | null—

The chosen value (controlled); null means nothing is chosen.

defaultValue?T | nullnull

The value it starts with (uncontrolled).

onValueChange?((value: T | null) => void)—

Reports a new value, or null after clearing.

placeholder?string'Choose an option'

Shown, muted, when nothing is chosen.

presentation?SelectionPresentation'auto'

popover anchors the list under the field; sheet slides it up; auto uses a popover for 7 options or fewer without search, and a sheet otherwise.

variant?"morph" | "sheet"undefined

1.x look: sheet means presentation="sheet"; morph renders Morph select (a pill that grows into its list).

searchable?booleanfalse

A search field above the options. Search needs the keyboard, so it implies a sheet.

clearable?booleanfalse

A clear button inside the field while a value is chosen.

pressDragRelease?booleantrue

★ Hold the field to open the popover, drag over the rows (a tick each) and release to pick. Popover only.

holdDelay?number350

How long the finger rests before the list opens, in milliseconds (content timing).

swipeToCycle?booleanfalse

★ Swipe the closed field sideways to step to the next or previous option. Screen readers get Next and Previous actions.

typeahead?booleantrue

On the web, typing letters on the field or in the list jumps to the next matching option.

rollValue?booleantrue

The value rolls up for a later option and down for an earlier one.

highlight?"glide" | "none"'glide'

One highlight glides to the chosen row and follows a drag; none draws nothing.

maxListHeight?number320

The popover's tallest height before it scrolls, in points.

helper?string—

Supporting text under the field.

error?string—

Validation message. A new one shakes the field once and plays an error haptic.

success?string—

Confirmation text; replaces the helper.

status?FieldStatus'idle'

Validation state shown on the field.

required?booleanfalse

Marks the field required; "Required" is spoken.

requiredIndicator?FieldRequiredIndicator'asterisk'

How a required field is marked.

optionalIndicator?booleanfalse

Show "Optional" after the label.

disabled?booleanfalse

Prevents opening, picking, swiping and clearing.

disabledStyle?FieldDisabledStyle'muted'

muted lightens the field without opacity; dim lowers it to 50%.

appearance?FieldAppearance'filled'

The field's surface.

size?FieldSize'md'

sm 36pt, md 44pt, lg 52pt.

shape?FieldShape'preset'

preset follows the preset's corners; pill is a capsule.

labelPlacement?FieldLabelPlacement'above'

Where the label sits: above, inside at the top (inset, best at lg), or spoken only. floating draws as inset.

focusRing?FieldFocusRing'halo'

The ring and halo shown while the list is open.

leadingIcon?ButtonIcon—

A leading icon in the field: a node, or a function given the state colour and size.

messages?Partial<SelectionMessages>SELECTION_MESSAGES (English)

Built-in strings, for translation.

haptics?boolean | SelectionHapticstrue

Haptics: a switch, or per part (select for picks and drag ticks, limit at the ends of a swipe, clear).

motion?MotionOverridethe app's feel

Field, list, highlight and value motion.

className?string—

Classes on the field.

style?StyleProp<ViewStyle>—

Field style.

testID?string—

The trigger's identifier. The list appends -option and rows -option-<value>; the clear button -clear.

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 auto anchors 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 and variant="morph" renders Morph select; for the 1.x look pass presentation="sheet".
PropDoesDefault
presentationauto, popover or sheetauto
searchableA search field; always a sheetfalse
clearableA clear button while a value is chosenfalse
pressDragRelease / holdDelay★ Hold, drag and release to pick (ms to hold)true, 350
swipeToCycle★ Swipe the closed field to stepfalse
typeaheadLetters jump to matches on the webtrue
rollValueThe value rolls in the direction of traveltrue
highlightglide or noneglide
maxListHeightThe popover's height before it scrolls (pt)320
groupsGroup headings, in ordernone
appearance / size / shapeField look: filled…, sm/md/lg, preset/pillfilled, md, preset
labelPlacementabove, inset or hiddenabove
leadingIconA node, or a function given { color, size }none
helper / error / successMessages under the fieldnone
required / disabledRequired mark; no opening, swiping or clearingfalse
hapticsAll, or { select, limit, clear }select, limit
messagesBuilt-in strings, for translationEnglish
motionA local motion feel or overridethe 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, drag and press motion roles, so it follows your app's feel. Pass motion to 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 onSupported
Expo SDK 57Yes
Expo SDK 58Yes
React Native CLI (with Expo modules)Yes
Expo GoYes
iOSYes
AndroidYes

This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.

Related items