Skip to content
nexubDesign System
v11.9.0

Components · Form Controls

Time Slot Picker

AlphaAdded v10.8.0

Pick one time from a list of slots, for booking flows.

import { TimeSlotPicker } from '@nexub/react';
View as Markdown

Playground

Props

size
columns
groupBy

Selected: 09:30

TSX
<TimeSlotPicker aria-label="Start time" slots={slots} value={time} onValueChange={setTime} />

Examples

Default

Selected: 09:30

Grouped by time of day

Morning
Afternoon
Evening

Times are shown in the venue’s time zone.

States

  • Selected: 09:30

    default
  • Selected: 09:30

    disabled
  • Selected: 09:30

    invalid
  • Selected: 09:30

    readOnly
  • Selected: 09:30

    size="sm"
  • Selected: 09:30

    size="md"
  • Selected: 09:30

    size="lg"

Props

Props
PropTypeDefaultDescription
slotsrequiredTimeSlot[]—The times. value is HH:mm or an ISO date-time; the label defaults to the time in the provider locale.
value / defaultValue / onValueChangestring—The selected slot value.
groupBy'none' | 'period''none'period adds Morning, Afternoon and Evening headings.
columns'auto' | 2 | 3 | 4'auto'Slots per row. auto fits as many as the width allows; 3 and 4 drop to fewer where the picker is narrow.
size'sm' | 'md' | 'lg''md'Slot height. md and lg are at least 44px tall.
invalid / disabled / readOnly / requiredboolean—Group states. Inside FormField.Control they come from the field.
namestring—Submits the selected value with a form.
emptyStateReact.ReactNode—Shown when slots is empty.
invalidboolean—
readOnlyboolean—Focusable but cannot change.

Accessibility

Keyboard

  • Tab

    Moves into the group, to the selected slot.

  • Arrow keys

    Move to and select the next available slot.

Notes

  • A radio group: give it an `aria-label` or `aria-labelledby` (it defaults to "Choose a time").

  • Unavailable slots are struck through and read as "9:30 AM, unavailable".

  • A slot is named by its time; `hint` is its description.

On iOS & Android