App, time-slot picker


Install
npx shadcn add @klarhimmel/app-scheduling-slotsDetailsAbout, usage, props and more
Pick a time: days across, times down, as a keyboard grid (arrow keys, Home and End, Space picks).
Import
Import
- app/scheduling-slots
- About
- Pick a time: days across, times down, as a keyboard grid (arrow keys, Home and End, Space picks). A taken slot says so in words, the choice is repeated in a status line, and idle, error, confirmed and empty states. Never submits.
- Category
- Interface sections for signed-in products. New project? Set it up once: /get-started/installation.
Notes
When to use it
A grid of days and times where the person picks one slot and confirms it. For a read-only overview of a month, use app-scheduling-calendar instead; this block exists for choosing, and it never submits anything itself.
Writing for it
- List the times once in times (2 to 8, 10 characters each) and mark the full ones per day in that day's unavailable list. A time you mention there must also exist in times. - selected starts the grid on a slot using the exact day label and time. Day labels hold 20 characters, so 'Tue 17 Nov' fits but a full date sentence does not. - The help line (160) is shown under the grid. Say what the keys do, and keep fullLabel to one word because a taken slot gets it in its accessible name.
Watch out for
With more than five days the grid gets wider and scrolls sideways, and scrollHint is only shown then. A selected slot that is marked unavailable is ignored, so the grid starts with nothing chosen.
Usage
The block in a page, with its default content (long lists shortened). Every prop is in the table below.
Props
The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.
| Prop | Type | Default | Description |
|---|---|---|---|
eyebrow | string | 'Name the service owner' | Text, up to 60 characters. Optional; empty is not rendered. |
title | string | 'Say what the person is choosing a t…' | Text, up to 120 characters. |
description | string | 'Say how long it takes and until whe…' | Text, up to 300 characters. Optional; empty is not rendered. |
legend | string | 'Available times' | Text, up to 60 characters. |
help | string | 'Say which keys move between times a…' | Text, up to 160 characters. |
days | { label, unavailable }[] | 5 items | List of 2 to 7. Each item: label, unavailable. |
times | string[] | 6 items | List of 2 to 8. |
selected | { day, time } | {…} | Fields: day, time. Optional; empty is not rendered. |
scrollHint | string | 'Say there are more days to the side.' | Text, up to 60 characters. |
fullLabel | string | 'Full' | Text, up to 20 characters. |
summary | string | 'Selected' | Text, up to 40 characters. |
none | string | 'Say nothing is chosen yet' | Text, up to 60 characters. |
at | string | 'at' | Text, up to 10 characters. |
confirm | string | 'Confirm booking' | Text, up to 30 characters. |
change | string | 'Change booking' | Text, up to 30 characters. |
state | 'idle' | 'error' | 'confirmed' | 'empty' | 'idle' | One of 'idle', 'error', 'confirmed', 'empty'. |
messages | { error, confirmed, empty, taken } | {…} | Fields: error, confirmed, empty, taken. |
headingLevel | '1' | '2' | - | One of '1', '2'. Optional; empty is not rendered. |