Argent

Select

One choice from a longer list. On React Native it opens as a sheet from the bottom.

import { Select } from '@rajatweb/argent'

<Select label="Plan" options={plans} onValueChange={setPlan} />

Props

PropTypeDefaultWhat it does
label requiredstring
options requiredreadonly Option[]
classNamestring
defaultValuestring
disabledboolean
errorstringError text. Also marks the field invalid.
hintstringHelp text under the field.
idstring
namestringForm field name.
onValueChange(value: string) => void
placeholderstring
requiredboolean
size'sm' | 'md' | 'lg''md'
valuestring

Accessibility

  • Works with arrow keys and type-ahead on the web.

Do

  • Order options by how often they are picked.

Don’t

  • Use it for two options.