Mobile › Inputs
Select
A field that opens a sheet of options and closes on a pick. It matches TextField, so a form keeps one look.
Installation
npx expo install plankui-mobile react-native-safe-area-context expo-hapticsUsage
import { Select } from "plankui-mobile";
const [country, setCountry] = useState<string | null>("pt");
<Select
label="Country"
value={country}
onChange={setCountry}
options={[
{ value: "pt", label: "Portugal" },
{ value: "es", label: "Spain" },
]}
/>iOS and Android
iOS: A filled rounded field with a down chevron; options open in a sheet with a check on the chosen one.
Android: A Material outlined field; options open in a bottom sheet with Material list rows.
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | Always visible above the field, and the sheet's title. | |
| value | string | null | The chosen option's value. | |
| options | SelectOption[] | { value, label, description?, disabled? } | |
| onChange | (value: string) => void | Called with the picked value; the sheet then closes. | |
| placeholder | string | "Choose" | Shown while nothing is chosen. |
| hint | string | – | Help text under the field. |
| error | string | – | Shown instead of the hint, in red, and read out. |
| disabled | boolean | false | Dims the field and blocks opening. |