fetaUI
GitHub

Slot Picker

Book a time by placing a block on a day. It snaps to 15 minutes and avoids busy time.

FreeWeb and MobileMotion

Preview

npx shadcn add @fetaui/slot-picker
Playground
Product walkthroughwith Lena Ortiz · Lisbon
BusyBusyBusy
Eastern Time · New York
Click a free gap, then drag to move
Short day
Product walkthroughwith Lena Ortiz · Lisbon
BusyBusyBusy
Eastern Time · New York
Click a free gap, then drag to move
Icons animation
Fail next action
Motion

Installation

Terminal· bash
 npx shadcn add @fetaui/slot-picker

Accessibility

  • The block is a vertical slider with a text value.
  • Days are a radio group.
  • Booked is announced.

Motion

  • A dashed ghost follows the pointer.
  • The block moves on a 320 and 30 spring, and tracks the pointer one to one during a drag.
  • With reduced motion, the block jumps.

Responsive behavior

  • 36 px per hour on Web and 40 px on Mobile.

Performance

  • The block animates top and height on a spring, and follows the pointer with no spring during a drag.
  • The ghost shows for a mouse only.

Note for AI

Give your coding assistant the Markdown reference instead of screenshots.

  • Import SlotPicker from @/components/fetaui/slot-picker. It composes Button and ToggleGroup.
  • busy is [start, end] in decimal hours, and from and to set the timeline.
  • A day whose free text is exactly Full is disabled.
  • onConfirm gets the day key, the start in decimal hours and the minutes. Return a promise to show loading until it resolves; a rejection keeps the slot and shows failedMessage. The demo books nothing.

Related