-
Notifications
You must be signed in to change notification settings - Fork 0
Select
<Select
data={data}
onSelect={console.log}
defaultValue={data[0]}
listHeight={300}
placeholderText='Hello!'
boxStyle={{
backgroundColor: '#48c',
}}
boxTextStyle={{
fontFamily: 'times new roman',
}}
listStyle={{
backgroundColor: '#abc',
}}
listTextStyle={{
color: 'brown',
fontFamily: 'times new roman',
}}
selectedItemStyle={{
backgroundColor: 'green',
}}
dropdownArrowColor='darkgreen'
/>These props are required to be utilized for the selector to function.
Type: Data[]
The items the user will be able to select from.
Type: Function (data: Data) => void
The function that is called when the user selects an item from the Selector.
These props are not required, but may add functionality that can be helpful.
Type: Data
Default value: undefined
An item that is selected before the user interacts with the Selector.
Type: boolean
Default value: false
A boolean representing if the user is unable to interact with the Selector.
Type: number
Default value: 200
The height of the dropdown list.
Type: string | React.JSX.Element
Default value: 'Click me'
The Selector text displayed when no item has been selected.
Type: boolean
Default value: false
A boolean representing if there should be a search bar for the Selector.
Type: ViewStyle
Default value:
{
display: 'flex',
flexDirection: 'row',
justifyContent: 'flex-start',
alignItems: 'center',
alignContent: 'space-between',
paddingVertical: 4,
paddingLeft: 8,
paddingRight: 24,
borderWidth: 0.5,
margin: 5,
overflow: 'hidden',
flexWrap: 'wrap',
}Custom styles for the main Selector box.
Type: TextStyle
Default value:
{
fontSize: 16,
overflow: 'hidden',
marginVertical: 4,
}Custom styles for the text inside the main Selector box.
Type: ViewStyle
Default value:
{
position: 'absolute',
borderWidth: 0.5,
overflow: 'hidden',
}Custom styles for the Selector dropdown list.
Type: TextStyle
Default value:
{
fontSize: 16,
paddingLeft: 8,
}Custom styles for the text inside the Selector dropdown list.
Type: TextStyle
Default value:
{
fontWeight: 'bold',
}Custom styles for the active item inside the Selector dropdown list.
Type: ColorValue
Default value: black or white for dark mode
Custom color for the dropdown arrow inside the main Selector box.
Type: TextStyle & ViewStyle
Default value:
{
paddingHorizontal: 8,
height: 40,
borderWidth: 1,
margin: 8,
}Cystom styles for the Selector search box.
Type: 'light' | 'dark' | 'system'
Default value: 'system'
The theme of the application.