Select
Selects allow the user to choose a single value from a list of options.
Import
import { Select } from '@nomada-sh/react-native-eyecandy';
Example
Props
items
| Type | Default |
|---|---|
| SelectItem[] | [] |
onChange
(value: any | undefined, index: number) => void;
| Type |
|---|
| function |
value
| Type |
|---|
| any |
placeholder
| Type | Default |
|---|---|
| string | 'Select and item...' |
onFocus
() => void;
| Type |
|---|
| function |
onBlur
() => void;
| Type |
|---|
| function |
isSelected
(item: SelectItem, value: any) => boolean;
| Type |
|---|
| function |
- 'item' (SelectItem): item to check.
- 'value' (any): value passed with the
valueprop.
closeOnSelect
| Type |
|---|
| boolean |
modalTitle
| Type |
|---|
| string |
emptyText
| Type | Default |
|---|---|
| string | 'No items' |
hideClearIcon
| Type |
|---|
| boolean |
icon
| Type |
|---|
| Icon |
color
| Type | Default |
|---|---|
'default' or 'error' | 'default' |
variant
| Type | Default |
|---|---|
'default' or 'outlined' | 'default' |
style
| Type |
|---|
| View Style |
marginTop
| Type |
|---|
| number |
marginBottom
| Type |
|---|
| number |
Type definitions
SelectItem
| Type |
|---|
| object |
Properties
| Name | Type | Required | Description |
|---|---|---|---|
| value | any | Yes | The value of the option |
| label | string | Yes | The label of the option |
| icon | Icon | No | The icon of the option |
| key | string | No | The key of the option |