Tailwind CSS styling
The most common approach is using Tailwind CSS classes via theclassNames prop:
Using data attributes
You can also target elements using data attributes for more specific styling:picker-styles.css
iOS-style picker
Create an iOS-like appearance:Material Design style
Create a Material Design-inspired picker:Dark mode support
Implement proper dark mode styling:CSS-in-JS with styled-components
If you prefer CSS-in-JS:Custom animations
Add custom transitions and animations:Available data attributes
All available data attributes for styling:| Attribute | Element | Description |
|---|---|---|
[data-rwp-wrapper] | Wrapper | Applied to WheelPickerWrapper |
[data-rwp] | Picker | Applied to WheelPicker root |
[data-rwp-options] | Container | Options list container |
[data-rwp-option] | Option | Each option item |
[data-rwp-highlight-wrapper] | Highlight | Highlight area wrapper |
[data-rwp-highlight-list] | Container | Highlight list container |
[data-rwp-highlight-item] | Item | Highlighted option item |
[data-rwp-focused] | State | Present when picker is focused |
[data-disabled] | State | Present on disabled options |
ClassNames prop reference
TheclassNames prop accepts these keys:
For more details on the
classNames prop, see the Styling guide.Tips for custom styling
Use CSS variables for theming
Use CSS variables for theming
Define CSS variables for colors and use them throughout your styles:
Maintain adequate contrast for accessibility
Maintain adequate contrast for accessibility
Ensure sufficient color contrast between options and background:Use tools like WebAIM Contrast Checker to verify contrast ratios.
Test with different option heights
Test with different option heights
The
optionItemHeight prop affects spacing. Test your styles with different heights:Next steps
Styling guide
Learn more about the styling system
API reference
See the full WheelPickerClassNames type definition