Liquid UI
Components

Liquid Wheel Picker

The iOS wheel picker, like the alarm time in the Clock app.

Installation

npx shadcn@latest add https://liquidcomponents.xyz/r/liquid-wheel-picker.json

Usage

import { LiquidWheel, LiquidWheelPicker } from "@/components/ui/liquid-wheel-picker"

const hours = Array.from({ length: 12 }, (_, i) => String(i + 1))
const minutes = Array.from({ length: 60 }, (_, i) => String(i).padStart(2, "0"))

export function AlarmTime() {
  return (
    <LiquidWheelPicker aria-label="Alarm time">
      <LiquidWheel aria-label="Hour" options={hours} defaultValue="7" />
      <LiquidWheel aria-label="Minute" options={minutes} defaultValue="30" />
      <LiquidWheel aria-label="Period" options={["AM", "PM"]} defaultValue="AM" />
    </LiquidWheelPicker>
  )
}

Scroll it, drag it or use the arrow keys. Rows curve around a drum and snap into the band. While a wheel turns, the band becomes a glass lens that magnifies whichever row is passing through it. Each wheel is a spinbutton to assistive technology.

Examples

Date

The day wheel follows the month and year, so February never offers the 30th.

Timer

<LiquidWheel aria-label="Minutes" options={minutes} unit="min" />

unit pins a label beside the selected row, like the timer in the Clock app.

One column

Options can be any text, not just numbers.

Controlled

Alarm 7:30 AM

const [hour, setHour] = useState("7")

<LiquidWheel aria-label="Hour" options={hours} value={hour} onValueChange={setHour} />

onValueChange fires once the wheel settles on a row, not on every frame of a spin.

API

LiquidWheel

PropTypeDefault
optionsArray<string | number | { value, label }>none
valuestringnone
defaultValuestringfirst option
onValueChange(value: string) => voidnone
unitReactNodenone
aria-labelstringrequired

LiquidWheelPicker

PropTypeDefault
lensLiquidLensOptionsgentle magnifier

Keyboard

KeyAction
↑ ↓Previous or next row
Page Up Page DownFive rows
Home EndFirst or last row

On this page