Skip to main content

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

TypeDefault
SelectItem[][]

onChange

(value: any | undefined, index: number) => void;
Type
function

value

Type
any

placeholder

TypeDefault
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 value prop.

closeOnSelect

Type
boolean

modalTitle

Type
string

emptyText

TypeDefault
string'No items'

hideClearIcon

Type
boolean

icon

Type
Icon

color

TypeDefault
'default' or 'error''default'

variant

TypeDefault
'default' or 'outlined''default'

style

Type
View Style

marginTop

Type
number

marginBottom

Type
number

Type definitions

SelectItem

Type
object

Properties

NameTypeRequiredDescription
valueanyYesThe value of the option
labelstringYesThe label of the option
iconIconNoThe icon of the option
keystringNoThe key of the option