Wheel Picker
Wheel Picker scrolls through labelled option values and exposes a selection callback.
Practical React example
Choose one duration from a short discrete set on a touch-oriented screen.
Before you copy and paste
Keep the example in the React rendering environment required by the imported component. Copy components/motion/wheel-picker.tsx and its returned support files from the Code tab; preserve the project-relative paths.
Listed package dependencies: clsx, motion, react, tailwind-merge.
Use the Code tab for the component files and installation instructions, then adapt the imports in this example to your project.
Choose one duration from a short discrete set on a touch-oriented screen
// Usage adapted from beUI's pinned MIT source.
// Copyright (c) 2026 Saurabh Chauhan. See ./LICENSES.md.
"use client";
import { useEffect, useState } from "react";
import { Switch } from "@/components/motion/switch";
import { WheelPicker } from "@/components/motion/wheel-picker";
const MONTHS = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
];
const YEARS = Array.from({ length: 60 }, (_, i) => String(1980 + i));
function daysIn(month: number, year: number) {
return new Date(year, month + 1, 0).getDate();
}
export function WheelPickerPreview() {
const [month, setMonth] = useState("June");
const [year, setYear] = useState("2004");
const [day, setDay] = useState("9");
const [sound, setSound] = useState(false);
const monthIndex = MONTHS.indexOf(month);
const dayCount = daysIn(monthIndex, Number(year));
const days = Array.from({ length: dayCount }, (_, i) => String(i + 1));
// A short month or a non-leap February can strand the day past the end —
// pull it back to the last valid day.
useEffect(() => {
if (Number(day) > dayCount) setDay(String(dayCount));
}, [day, dayCount]);
return (
<div className="flex flex-col items-center gap-4">
<span className="text-sm text-muted-foreground">
Born{" "}
<span className="font-medium text-foreground tabular-nums">
{month} {day}, {year}
</span>
</span>
<div className="flex items-stretch gap-1 rounded-3xl border border-border bg-background p-2">
<WheelPicker
options={MONTHS}
value={month}
onValueChange={setMonth}
className="w-32 border-0 bg-transparent"
visibleCount={7}
itemHeight={42}
sound={sound}
aria-label="Month"
/>
<WheelPicker
options={days}
value={day}
onValueChange={setDay}
className="w-14 border-0 bg-transparent"
visibleCount={7}
itemHeight={42}
sound={sound}
aria-label="Day"
/>
<WheelPicker
options={YEARS}
value={year}
onValueChange={setYear}
className="w-20 border-0 bg-transparent"
visibleCount={7}
itemHeight={42}
sound={sound}
aria-label="Year"
/>
</div>
<Switch
checked={sound}
onCheckedChange={setSound}
label="Tick sound"
className="origin-left scale-[0.85] [&_label]:text-sm"
/>
</div>
);
}
Usage example adapted from beUI's pinned MIT source. Retain the source licence notices when copying.
Use stable option values and retain a visible label for the chosen unit. Choose a visibleCount that leaves the selection understandable in a narrow panel.
Customization
- WheelPickerProps.options
- Required; WheelPickerOption[].
- WheelPickerProps.value
- Optional; string.
- WheelPickerProps.defaultValue
- Optional; string.
- WheelPickerProps.onValueChange
- Optional; (value: string) => void.
- WheelPickerProps.visibleCount
- Optional; number. Rows visible through the window, odd. More = flatter curve. Default 5.
- WheelPickerProps.itemHeight
- Optional; number. Row height in px. Default 36.
- WheelPickerProps.disabled
- Optional; boolean.
- WheelPickerProps.sound
- Optional; boolean. Play a short tick each time the selected value changes. Default false.
- WheelPickerProps.className
- Optional; string.
- WheelPickerProps."aria-label"
- Optional; string.
- SwitchProps.checked
- Required; boolean.
- SwitchProps.onCheckedChange
- Required; (checked: boolean) => void.
- SwitchProps.disabled
- Optional; boolean.
- SwitchProps.label
- Optional; string.
Integration notes
- Leave sound off unless it is an intentional, user-understood preference.
- Check keyboard selection and that the selected value is included in the saved form data.
Component source: beUI documentation . These examples describe the version imported into Rendyn. Upstream APIs may have changed; retain the source licence notices when adapting the code.
Give your agent taste.
The best way to use Rendyn is through MCP. Let your agent find the right component, compare previews and bring the source into your project.
All components are free. Sign up only to connect MCP.