Skip to content
StackD
Wheel picker, the StackD component

Inputs · Free

Wheel picker

A quiet picker wheel like iOS: only the choice at rest, the neighbours curve out as you spin; flick, soft landing, loops for hours and minutes, text or icons.

Free on Gumroad: the download arrives in your inbox.

Details

Category
Inputs
Plan
Free
Code
React + Tailwind, TypeScript · 283 lines
Files
WheelPicker.tsx
Needs
React and Tailwind only
Agents
MCP server and shadcn registry

About

A picker wheel like the one on iOS, but quiet. The options sit on a vertical cylinder you spin. At rest only the chosen one shows; the top and bottom fade away. Start spinning and the neighbours come out of the dark, curving back on the wheel. Let go and it carries on with your flick, then lands on an option with a soft overshoot, the rows stretching a little with the speed, like jelly.

It stops with a rubbery give at the ends, or loops round and round for hours and minutes. Options can be text or icons (in the store, the StackD Bot's shapes). Each option that passes the middle can give a haptic tick on phones that support it.

React + Tailwind, no other libraries.

Install

With the shadcn CLI:

npx shadcn@latest add https://www.stackd.codes/r/wheel-picker.json

Or let your agent add it through the StackD MCP server:

claude mcp add --transport http stackd https://www.stackd.codes/mcp

Prompt for your agent

Paste it into Claude Code, Cursor, Codex or VS Code once the MCP server is connected.

Add the StackD Wheel picker component to this project. Use the StackD MCP server: call get_component with { "name": "wheel-picker" }, write the files at the paths it gives and install any npm packages it lists. Then use it where it fits, following its README for the props, and keep its own styles.

Use

  1. Copy WheelPicker.tsx into your project (for example components/).
  2. Use it:
import { WheelPicker, type WheelItem } from './components/WheelPicker'

const hours: WheelItem[] = Array.from({ length: 24 }, (_, i) => ({ id: `h${i}`, label: String(i).padStart(2, '0') }))
const minutes: WheelItem[] = Array.from({ length: 12 }, (_, i) => ({ id: `m${i * 5}`, label: String(i * 5).padStart(2, '0') }))

const [hour, setHour] = useState('h10')
const [min, setMin] = useState('m30')

<div className="flex items-center">
  <WheelPicker items={hours} value={hour} onChange={(item) => setHour(item.id)} loop width={84} label="Hour" />
  <span>:</span>
  <WheelPicker items={minutes} value={min} onChange={(item) => setMin(item.id)} loop width={84} label="Minutes" />
</div>

// With icons: any React node, shown above its label
<WheelPicker items={[{ id: 'tea', label: 'Tea', icon: <TeaIcon /> }, { id: 'coffee', label: 'Coffee', icon: <CoffeeIcon /> }]} />

In Next.js the file already starts with 'use client'. In other React setups that line does nothing.

Options

PropDefaultWhat it does
items{ id, label, icon? }
valueThe chosen id, when you control it
defaultValuethe firstThe chosen id at the start, when you don't
onChangeCalled with the item and its index when the wheel settles on a new one
onTickCalled each time an option passes the middle (for your own haptics or sound)
itemHeight56 (132 with icons)Height of one row in px
rows3.4Height of the wheel, in rows
width220Width in px (or any CSS width)
loopfalseSpin round and round instead of stopping at the ends
theme'light''light' or 'dark'
label'Choose'Read out by screen readers
reveal0Hold the neighbours visible, 0 to 1, as if it were spinning: for covers and mock-ups
classNameExtra classes

Accessibility

The wheel is a spin button with its label and the chosen option read out. Up and Down move one option, Page Up and Page Down five, Home and End go to the first and last. A tap above or below the middle moves one way; the mouse wheel and trackpad spin it too.

Colours from StackD

White #FFFFFF · Ink #141310 · Wine #901919 · Olive #6C8544 · Ochre #BE9344 · Lilac #C9B8FF

Licence

You can use it in personal and commercial projects. Don't resell or share the component on its own.