Picker

Picker is a modal with options that you can choose 1 selection

pickerNotSelected pickerSelected

Usage#

import { View } from 'react-native';
import { Picker, Text, Section, SectionContent } from 'react-native-rapi-ui';
const Forms = () => {
const [pickerValue, setPickerValue] = React.useState(null);
const items = [
{ label: 'Front-end Developer', value: 'FED' },
{ label: 'Back-end Developer', value: 'BED' },
{ label: 'Full-stack Developer', value: 'FSD' },
];
return (
<Section style={{ marginHorizontal: 20, marginTop: 20 }}>
<SectionContent>
<View>
<Text style={{ marginBottom: 10 }}>Picker</Text>
<Picker
items={items}
value={pickerValue}
placeholder="Choose your role"
onValueChange={(val) => setPickerValue(val)}
/>
</View>
</SectionContent>
</Section>
);
};
export default Forms;

Properties#

propsrequiredvalueDefault Value
placeholderYesstring
valueYesstring nullfalse
onValueChangeYes(newValue: string) => voidnull) => void`
itemsYes[{label: string, value: string}]
disabledNobooleanfalse
backgroundColorNostring#ffffff
borderColorNostring#d8d8d8
borderWidthNonumber1
borderRadiusNonumber8
selectionBackgroundColorNostring#ffffff
selectionBorderRadiusNonumber8`
iconColorNostring#939393
labelColorNostring#000000
closeIconColorNostring#FF3F35
labelSizeNoh1 h2 h3 xl lg md smlg
placeholderSizeNoh1 h2 h3 xl lg md smmd
placeholderColorNostring#939393