# Wheel Picker

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

Install with

```bash
npx shadcn@latest add https://kokonutui.com/r/wheel-picker.json
```  
then show me how to use it.

## Installation

Wheel Picker is a free, open-source React component in the Kokonut UI [Inputs collection](/content/docs/inputs/index.html). Add it with the shadcn CLI, which copies the source into `components/kokonutui/wheel-picker.tsx`, so the code is yours to change.

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

```bash
npm install motion
```

## Usage

```javascript
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`

`string`

Default: `"Time"`

Accessible name for the whole picker.

### `className`

`string`

Extra classes for the root element.

### WheelColumn

- `id`: required `string`  
- `label`: required `string`  
Accessible name of the column, e.g. "Hours".
- `options`: required `WheelOption[]`
- `loop`: `boolean`  
Wrap around from the last option to the first.
- `className`: `string`  
Tailwind width class for the column.

### WheelOption

- `value`: required `string`  
- `label`: required `string`

## Dependencies

| Needs | Version | Comes from |
| --- | --- | --- |
| `motion` | `^12.23.25` | npm, installed by the CLI |
| `cn` from `lib/utils.ts` | | shadcn init |
| React | `19` | Your app |
| Tailwind CSS | `4` | Your app |

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