Skip to Content
Kokonut UI

IN-06Inputs

Wheel Picker

iOS-style 3D drum picker with flick momentum, built with React and Motion.

Install with
motion

PRONatural Date Input and more like it are in Kokonut UI Pro

Installation

Wheel Picker is a free, open-source React component in the Kokonut UI Inputs collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/wheel-picker.tsx, so the code is yours to change.

npx shadcn@latest add @kokonutui/wheel-picker

Or add it by hand: install its packages, then copy the source from Copy code above into components/kokonutui/wheel-picker.tsx.

npm install motion

Usage

import WheelPicker from "@/components/kokonutui/wheel-picker";

export default function Example() {
  return <WheelPicker />;
}

Props

columns
WheelColumn[]Default built-in
value
Record<string, string>

Controlled selection, keyed by column id.

defaultValue
Record<string, string>Default built-in

Initial selection when uncontrolled.

onValueChange
(value: Record<string, string>) => void

Called once a wheel comes to rest on a new option.

label
stringDefault "Time"

Accessible name for the whole picker.

className
string

Extra classes for the root element.

WheelColumn

idrequired
string
labelrequired
string

Accessible name of the column, e.g. "Hours".

optionsrequired
WheelOption[]
loop
boolean

Wrap around from the last option to the first.

className
string

Tailwind width class for the column.

WheelOption

valuerequired
string
labelrequired
string

Dependencies

NeedsVersionComes from
motion^12.23.25npm, installed by the CLI
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

No provider, font or global CSS to set up: the file works as soon as it lands.