Skip to main content

Select

The Select component has only one required prop, which is the options prop.

Props

Basic

NameTypeDefaultDescriptionExample
options (required)OptionsType<T>An array of objects that represents the available options for a Select.
animationboolean | numbertrue | 200An options list open-close animation can be enabled or disabled using a boolean parameter. The duration of the animation can be set using a number parameter. If you pass 0 as the duration, the animation is still occur but will be instantaneous.
clearablebooleantrueShow a clear button to remove selected option.
closeOptionsListOnSelectbooleantrueClose the options list after selected option.
defaultOptionOptionType<T>An object that represents the default option for a Select.
disabledbooleanfalseDisable a Select pressable.
hasBackdropbooleantrueDetermines whether a Select component should have a Backdrop component.
hideArrowbooleanfalseDetermines the arrow icon should be displayed.
multiplebooleanfalseDetermines whether a Select component should allow the user to select multiple options.
noOptionsTextstringNo optionsDetermines the text that should be displayed when there are no available options in a Select component.
placeholderTextstringSelect...Determines the placeholder text that should be displayed in a Select component when no option is selected.
placeholderTextColorstring#808080Determines the color of the placeholder text in a Select component.
scrollToSelectedOptionbooleantrueDetermines whether a Select component should automatically scroll to the selected option when the options list is opened.
pressableSelectedOptionbooleantrueDetermines whether the selected option should still be pressable after it has been selected.
searchablebooleanfalseDetermines whether a Select component should include a search field that allows the user to filter the options by keyword.
searchPattern(payload: string) => string(payload: string) => (${payload})Regex definition for searching options.To Do
stylesSelectStylesAn object that represents the styles for a Select component.To Do
themenone | light | darknonePre-prepared styles for light and dark theme. They can be overwritten.

Styles

NameTypeDescriptionNoteExample
styles.select.containerStyleProp<ViewStyle>Style for the select.To Do
styles.select.textStyleProp<TextStyle>Style for the select text.If you want to change a color of placeholder use placeholderTextColor propsTo Do
styles.select.disabledStyleProp<ViewStyle>Style for the disabled select.To Do
styles.select.buttonsStyleProp<ViewStyle>Style for the buttons container the right side.To Do
styles.select.multiSelectedOption.containerStyleProp<ViewStyle>Style for the selected option in select control.To Do
styles.select.multiSelectedOption.textStyleProp<ViewStyle>Style for the selected option text in select control.To Do
styles.select.multiSelectedOption.pressedStyleProp<ViewStyle>Style for the pressed selected option in select control.To Do
styles.select.arrow.containerStyleProp<ViewStyle>Style for the arrow container.To Do
styles.select.arrow.iconStyleProp<ImageStyle>Style for the arrow icon.To Do
styles.select.clear.containerStyleProp<ViewStyle>Style for the clear option button.To Do
styles.select.clear.iconStyleProp<ImageStyle>Style for the clear option icon.To Do
styles.select.leftIconStyleProp<ImageStyle>Style for the custom left icon.To Do
styles.option.containerStyleProp<ViewStyle>Style for the single option.To Do
styles.option.pressedStyleProp<ViewStyle>Style for the pressed single option.To Do
styles.option.selected.containerStyleProp<ViewStyle>Style for the selected single option.To Do
styles.option.selected.textStyleProp<ViewStyle>Style for the selected single option text.To Do
styles.option.textStyleProp<TextStyle>Style for the single option text.To Do
styles.optionsListStyleProp<ViewStyle>Style for the options list container.To Do
styles.noOptions.containerStyleProp<ViewStyle>Style for the no options container.To Do
styles.noOptions.textStyleProp<TextStyle>Style for the no options text.To Do
styles.sectionHeader.containerStyleProp<ViewStyle>Style for the section header.To Do
styles.sectionHeader.clear.iconStyleProp<ImageStyle>Style for the section header clear icon.To Do
styles.sectionHeader.pressedStyleProp<ViewStyle>Style for the pressed section header.To Do
styles.sectionHeader.selected.containerStyleProp<ViewStyle>Style for section header when all section options are selected.To Do
styles.sectionHeader.selected.textStyleProp<TextStyle>Style for section header text when all section options are selected.To Do
styles.sectionHeader.textStyleProp<TextStyle>Style for the section header text.To Do
styles.backdropStyleProp<ViewStyle>Style for backdrop.To Do

Callbacks

NameTypeDescriptionExample
onSectionSelect(options: OptionType<T>[], optionIndexes: number[]) => voidCalled when section is selected with section header.To Do
onSectionRemove(options: OptionType<T>[], optionIndexes: number[]) => void;Called when section is removed with section header.To Do
onSelect(option: OptionType<T>, optionIndex: number) => voidCalled when option is selected.To Do
onSelectChangeText(text: string) => voidCalled when text is changed in select input..To Do
onSelectOpened() => voidCalled when Select is opened.To Do
onSelectClosed() => voidCalled when Select is closed.To Do
onRemove(option: OptionType<T>, optionIndex: number) => void;Called when a single option is cleared.To Do

Methods

NameTypeDescriptionExample
open() => voidOpen a Select.To Do
clear() => { removedSelectedOption?: OptionType<T> | null; removedSelectedOptionIndex?: number; removedSelectedOptions?: OptionType<T>[] | null; removedSelectedOptionsIndexes?: number[]; }Clear a selected option(s).To Do
close() => voidClose a Select.To Do
getState() => State<T>Get current state of Select.To Do

Customizable

NameTypeDescriptionExample
arrowContainerPropsOmit<ViewProps, 'style'>Override the arrow props.To Do
arrowImagePropsOmit<ImageProps, 'style'>Override the arrow image props.To Do
backdropChildPropsOmit<ViewProps, 'style'>Override the backdrop child element props.To Do
backdropPropsOmit<TouchableWithoutFeedbackProps, 'onPress'>Override the backdrop element props.To Do
clearOptionButtonPropsOmit<ViewProps, 'style' | 'onPress'>Override the clear option button props.To Do
clearOptionImagePropsOmit<ImageProps, 'style'>Override the clear option image props.To Do
flatListPropsOmit<FlatListProps<OptionType>, 'ref' | 'data' | 'getItemLayout' | 'renderItem' | 'keyExtractor'>Override the options list props.
noOptionsPropsOmit<ViewProps, 'style'>Override the no options element props.To Do
noOptionsTextPropsOmit<TextProps, 'style'>Override the no options text props.To Do
optionButtonPropsOmit<PressableProps, 'ref' | 'style' | 'onPress' | 'accessibilityRole' | 'accessibilityState' | 'disabled'>Override the option button props.To Do
optionTextPropsOmit<TextProps, 'style'>Override the option text props.To Do
selectContainerPropsOmit<PressableProps, 'ref' | 'style' | onPress'>Override the select container props.To Do
selectInputPropsOmit<TextInputProps, 'ref' | 'editable' | 'placeholder' | 'placeholderTextColor' | 'style' | 'textAlign' | 'value' | 'onChangeText' | onPressIn'>Override the select input props.To Do
selectLeftIconImagePropsOmit<ImageProps, 'style'>Override the select left icon image props.To Do
selectLeftIconsPropsOmit<ViewProps, 'style'>Override the select left icons props.To Do
selectRightIconsPropsOmit<ViewProps, 'style'>Override the select right icons props.To Do
selectTextPropsOmit<TextProps, 'style'>Override the select text props.To Do
sectionHeaderButtonPropsOmit<ViewProps, 'style' | 'onPress'>Override the section header button props.To Do
sectionHeaderImagePropsOmit<ImageProps, 'style'>Override the section header image props.To Do
sectionHeaderTextPropsOmit<TextProps, 'style'>Override the section header text props.To Do
sectionListPropsOmit<SectionListProps<OptionType>, 'ref' | 'renderSectionHeader' | 'sections' | 'getItemLayout' | 'renderItem' | keyExtractor | onLayout>Override the sections options list props.To Do