Index to initially center.
Data to display.
OptionalgetFunction to retrieve the text to display for an element as a label.
OptionalcontainerFunction called when the layout of the container changes.
Example usage for monitoring the container's height:
const [pickerHeight, setPickerHeight] = useState<number>(0);
const onLayout = useCallback((event: LayoutChangeEvent) => {
const { height } = event.nativeEvent.layout;
setPickerHeight(height);
}, []);
return (
<View style={{flexDirection: "row"}}>
<View style={{height: height}}>
<Text>Picker label</Text>
</View>
<RepeatingWheelPicker
//...
containerOnLayout={onLayout}
/>
</View>
);
layout change event that triggered onLayout
OptionalenabledEnables / disables scrolling of the wheel picker.
OptionalitemHeight per displayed item.
OptionalitemNumber of items to display.
OptionalcontainerVertical padding for the container of the wheel picker.
OptionalcontainerHorizontal padding for the container of the wheel picker.
OptionalcontainerStyling for the container of the wheel picker.
OptionalitemStyling for the container of each element.
OptionalitemStyling for the text of the elements.
OptionalenableIf enabled, will show a gradient fade towards the top and bottom of the wheel picker.
OptionalgradientColor the gradient should fade to at the top and bottom.
Function to set currently selected element and use it in your application.