suiss/uim · Pattern

Picker

A select field that opens a list of options anchored below it, with optional groups and separators.

Picker is an open-source mobile pattern from suiss/uim: components composed into a flow for React Native and Expo, with SwiftUI and Jetpack Compose versions built from the same design tokens. The @esuiss/uim CLI copies its source into your project, so you own the code.

iOS
Picker on iOS in light mode

Picker composes Select: a SelectTrigger showing the current value and a SelectContent popup with the options. The selected option shows a check mark.

Use it to choose one value from a short or grouped list in a form.

Installation

$ pnpm dlx @esuiss/uim@latest add picker

The CLI also adds what it builds on: Select.

Manual

  1. Add the pieces it builds on: Select.

  2. Copy the source into components/patterns/picker.tsx:

uniwind/components/patterns/picker.tsx
import * as React from "react"
import {
  Select,
  SelectContent,
  SelectGroup,
  SelectItem,
  SelectLabel,
  SelectSeparator,
  SelectTrigger,
  SelectValue,
} from "@/components/ui/select"

type PickerItemData = {
  value: string
  label: React.ReactNode
}
  1. Update the import paths to match your project.

Usage

import { Picker, PickerGroup, PickerItem, PickerSeparator } from "@/components/patterns/picker"
<PickerDemo />

List PickerItems as children, optionally inside PickerGroups separated by PickerSeparator. The picker collects the items from its children to show the selected label, or you can pass items directly.

Use it uncontrolled with defaultValue, or controlled with value and onValueChange. placeholder shows while nothing is selected.

Examples

States

A small picker with a value, an invalid picker and a disabled picker.

iOS
Picker (states) on iOS in light mode

API Reference

Picker

The root that renders the trigger and the options popup.

PropType
About
The selected value when controlled.
Type
string
Default
—
About
The initial value when uncontrolled.
Type
string
Default
—
About
Called with the new value when an option is chosen.
Type
(value: string) => void
Default
—
About
Text shown when no value is selected.
Type
string
Default
—
About
{ value, label } pairs used to show the selected label; collected from children when omitted.
Type
PickerItemData[]
Default
—
About
Trigger height: sm or default.
Type
"sm""default"
Default
"default"
About
Prevents opening the list.
Type
boolean
Default
—
About
Applies the error style to the trigger.
Type
boolean
Default
—
Type
string
Default
—
About
Label for the trigger.
Type
string
Default
—
About
Links the trigger to a visible label.
Type
string
Default
—
Type
React.ReactNode
Default
—

PickerGroup

Groups options under an optional label.

PropType
About
Heading shown above the group.
Type
string
Default
—
Type
React.ReactNode
Default
—

PickerItem

One selectable option.

PropType
About
The value this option selects.
Type
string
Default
required
About
Prevents choosing this option.
Type
boolean
Default
—
Type
React.ReactNode
Default
—

Accessibility

  • Give the picker an accessibilityLabel or accessibilityLabelledBy, since the trigger shows only the value.

Notes

  • The popup uses bg-surface-raised with a subtle border that is stronger in dark mode.
  • The popup fades in and out, and respects the system reduce motion setting.
  • On iOS the popup renders in a full-window overlay so it appears above native screens.