Pro unlocks unlimited templates48:00:00Get Pro →

Availability Slots

Bookable time buttons for a single day — the Cal.com-style picker. Pair with Calendar for the date, and use Availability when hosts edit weekly free hours.

Gallery

Calendar + time list — pick a day, then choose a free opening.

Loading…

Installation

CLI
npx @sonojs/ui@latest add availability-slots
Also needs
npx @sonojs/ui@latest add button

Usage

availability-slots.tsx
import {
  AvailabilitySlots,
  expandRangesToTimeSlots,
} from "@/components/availability-slots"

const slots = expandRangesToTimeSlots(
  [{ startMinutes: 9 * 60, endMinutes: 12 * 60 }],
  30
)

export function Example() {
  return (
    <AvailabilitySlots
      slots={slots}
      onValueChange={(id) => console.log(id)}
    />
  )
}

Props

PropTypeDefaultDescription
slotsAvailabilityTimeSlot[]-Bookable openings (`id`, `startMinutes`, optional `endMinutes` / `label` / `disabled`).
valuestring · null-Controlled selected slot id.
defaultValuestring · nullnullInitial selection when uncontrolled.
onValueChange(value: string · null) => void-Fires on select; click again to clear.
columns1 · 2 · 31Button grid density.
emptyTextstring"No times available"Copy when `slots` is empty.
disabledbooleanfalseDisables every slot.
classNamestring-Merged onto the root.

Related