WheelPicker
iOS-style wheel picker with smooth scrolling, visual feedback, and performance optimizations
- Stable unknown
- Release candidate since 1.16.1-rc.3
- Development since 1.16.1-dev.2111+9796905
iOS-style wheel picker component with smooth scrolling, visual feedback animations, and performance optimizations. Built with react-native-reanimated and optimized FlatList for 60fps performance.
Quick Example
import { WheelPicker } from "@ovok/native/picker-sheet";
import { useAppTheme } from "@ovok/native";
import React from "react";
const options = ["Small", "Medium", "Large", "Extra Large"];
const WheelPickerExample = () => {
const theme = useAppTheme();
const [selectedIndex, setSelectedIndex] = React.useState(0);
return (
<WheelPicker
selectedIndex={selectedIndex}
options={options}
onChange={setSelectedIndex}
itemHeight={50}
visibleItems={5}
selectedIndicatorStyle={{
backgroundColor: theme.colors.primaryContainer,
}}
/>
);
};
export default WheelPickerExample;Props
Every prop, with its type and description, is listed in the @ovok/native/picker-sheet API reference.
Component Behavior
The WheelPicker component:
- Smooth Scrolling: Uses animated FlatList with optimized scroll handling
- Visual Feedback: Items scale and fade based on distance from center
- Snap to Position: Automatically snaps to the nearest item on scroll end
- Performance Optimized: Efficient rendering with proper item layout calculations
- Gesture Handling: Supports both scrolling and momentum-based selection3
The option shown in the center selection indicator is the option identified by
selectedIndex. Scrolling calls onChange with that same option's zero-based
index, including when options contains fewer values than visibleItems.
Styling
Theme Colors Used
theme.colors.surfaceVariant- Default selection indicator backgroundtheme.borderRadius(2)- Default border radius for selection indicator
Related Components
- PickerSheet - Bottom sheet container for WheelPicker
External Dependencies
- react-native-reanimated - For smooth animations and scroll handling
- react-native-gesture-handler - For scroll gestures
Last updated on