@gfazioli/mantine-picker
A Mantine component that allows you to create a picker effect with a list of elements.
Installation
After installation import package styles at the root of your application:
You can import styles within a layer @layer mantine-picker by importing @gfazioli/mantine-picker/styles.layer.css file.
Usage
The Picker component allows you to create a picker effect with any list of items.
It's inspired by the iOS picker and allows you to create a similar effect with any list of items.
- You can drag up and down to select the item you want
- You may also use the mouse wheel to scroll through the items
- Of course, you can also click on the item to select it
- Finally, you can use the keyboard to navigate through the items
Value: RomeControlled
Pass both value and onChange to use the Picker in controlled mode. The selected item is fully owned by your state, and the picker mirrors any external value change (e.g. from a Select or another input bound to the same state).
Value: AprilBy default the Picker is uncontrolled β omit value/onChange and optionally set defaultValue to choose the initial item. onChange is still called on every change if you provide it.
Scroll lifecycle
Pass onScrollStart and onScrollEnd to react to interaction boundaries β useful for analytics, haptic feedback, or coordinating multiple pickers in a group. A single continuous interaction (drag β momentum, or wheel + animated snap) only fires the pair once: onScrollStart triggers when the picker leaves the idle state, onScrollEnd fires when every internal animation, momentum, drag and wheel debounce has settled.
Status:
start: 0 Β· end: 0
Haptic feedback
Set hapticFeedback to trigger a short navigator.vibrate() pulse on supported devices whenever the selected item changes, giving the picker a native iOS/Android feel. Pass true to use the default 15ms duration, or a number for a custom duration in milliseconds. Desktop browsers and devices without vibration support silently no-op.
Open this demo on a phone or tablet to feel the haptic pulse on every selection change. Desktop browsers silently ignore navigator.vibrate.
Pulse duration: 15ms
renderItem
You can use the renderItem prop to customize the rendering of each item. This prop receives the item as arguments and should return the JSX to be rendered.
Value: 3D Effect
The Picker features a built-in 3D cylinder rotation effect inspired by the iOS picker. Configure it with:
enable3Dβ toggle the 3D effect (default:true)perspectiveβ depth perspective in pixels (default:300)maxRotationβ maximum rotation angle in degrees (default:60)cylinderRadiusβ curvature factor (default:4)rotateYβ rotate the entire picker along the Y-axis (default:0)
Visual Effects
Non-selected items can be styled with gradual blur, opacity, and scale effects:
maxBlurAmountβ maximum blur in pixels for non-selected items (default:0)minItemOpacityβ minimum opacity at the edges (default:0.3)minItemScaleβ minimum scale at the edges (default:0.85)
Blur
Opacity
Scale
Combined
Mask
Enable a gradient mask at the top and bottom edges with withMask. Control the gradient intensity with maskHeight (percentage of picker height) and maskIntensity (gradient opacity).
Default (no mask)
With mask
Intense mask
Left and Right Sections
You can use the leftSection and rightSection props to add custom content to the left and right sides of the picker. This is useful for adding icons, buttons, or any other content you want.
As you can see, by using leftSection and rightSection props you can add any content you want to the left and right sides of the picker. In these cases the sections are fixed and do not scroll with the items. They will also inside the picker.
Alternatively, you can use a simple <Group/> component to add any left (center) and right section you want.
π
π
:
Styles the Picker
You can change the default styles of the items by using the same props you use in the <Text/> component.
readOnly
In addition to the disabled prop, you can use the readOnly prop to make the picker read-only. This will prevent the user from changing the selected item, but will still allow you to change it programmatically. It can be useful when you want to display the selected item without allowing the user to change it.
Accessibility
The Picker component provides built-in keyboard navigation and screen reader support:
- Arrow Up/Down β move one item up/down
- Home/End β jump to first/last item
- Page Up/Down β move 5 items at a time
role="listbox"androle="option"for semantic structurearia-selectedon the active itemaria-disabledandaria-readonlywhen applicable
Use the id, label, description, and keyboardHint props to provide additional context for assistive technologies. Set focusable={false} to exclude the picker from the tab order.
Example: Time Picker
The Picker component can be used as a Time Picker. You can use the renderItem prop to customize the rendering of each item and the onChange prop to handle the selection logic. In this example, we will create a simple time picker that allows you to select the hour and minute.
π
:
min
Selected time: 18:47
:
Selected time: 06:47 pm
Example: Date Picker
The Picker component can be used as a Date Picker.
Selected date: 26 April 2026
Example: Color Palette
renderItem can return any JSX, so a colour swatch next to the label is a one-liner. The selected colour is mirrored back to a preview block to make the picker feel like a proper colour control.
Example: Alarm clock
A small iOS-style alarm clock combining three pickers (hours, minutes, AM/PM), hapticFeedback on every wheel tick, and a final vibration burst when the alarm is armed.
:
No alarm set
Example: Slot Machine
As funny as it may sound, the Picker component can be used to create a slot machine effect β three reels spin at different speeds, stop sequentially, and emit a tactile pulse on every reel landing (and a longer pattern on a jackpot).
Place your bet!