tinkerers-labs

Wheel Picker

Forms

About

A scrolling wheel for one value out of a long ordered list: an hour, a minute, a year, a size. Several wheels side by side make a time picker.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Wheel Picker to your project and fits it to your theme.

Code

How Wheel Picker is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client"

import * as React from "react"

import {
  WheelPicker,
  WheelPickerGroup,
} from "@/components/ui/mischief-wheel-picker"

const hours = Array.from({ length: 12 }, (_, index) => ({
  value: String(index + 1),
  label: String(index + 1),
}))

const minutes = Array.from({ length: 12 }, (_, index) => {
  const minute = String(index * 5).padStart(2, "0")
  return { value: minute, label: minute }
})

const periods = [
  { value: "AM", label: "AM" },
  { value: "PM", label: "PM" },
]

export default function WheelPickerDemo() {
  const [hour, setHour] = React.useState("7")
  const [minute, setMinute] = React.useState("30")
  const [period, setPeriod] = React.useState("AM")

  return (
    <div className="bg-background border-border w-full max-w-[20rem] rounded-[1.25rem] border p-5 shadow-sm">
      <p className="text-sm font-medium">Daily reminder</p>
      <p className="text-muted-foreground mt-1 text-sm">
        We will nudge you at{" "}
        <span className="text-foreground font-medium tabular-nums">
          {hour}:{minute} {period}
        </span>
        .
      </p>

      <WheelPickerGroup className="mt-5" label="Reminder time">
        <WheelPicker
          label="Hour"
          loop
          onValueChange={setHour}
          options={hours}
          value={hour}
        />
        <WheelPicker
          label="Minute"
          loop
          onValueChange={setMinute}
          options={minutes}
          value={minute}
        />
        <WheelPicker
          label="AM or PM"
          onValueChange={setPeriod}
          options={periods}
          value={period}
        />
      </WheelPickerGroup>
    </div>
  )
}

More by tinkerers-labs

View all
  • Prompt Input

    Prompt Input

    11
  • Burst

    Burst

    4
  • Quantity Button

    Quantity Button

    1
  • Undo Button

    Undo Button

  • Tool Approval

    Tool Approval

  • Notification Stack

    Notification Stack

  • Swipe Actions

    Swipe Actions

  • Sparkline

    Sparkline

More in Forms

View all
  • Form

    Form

    7
  • Login 2

    Login 2

    16
  • Contact Form

    Contact Form

    33
  • Contact Card

    Contact Card

    1.1K
  • Book A Demo 1

    Book A Demo 1

    95
  • Premium Auth

    Premium Auth

    614
  • Onboarding Stepper

    Onboarding Stepper

    13
  • Authentication Card

    Authentication Card

    52