---
title: "Time Slots"
description: "A grid of the free times of one day, grouped by morning and afternoon. Booked times show struck through, and a person cannot pick them."
url: https://gelatinui.com/components/time-slots
markdown_url: https://gelatinui.com/components/time-slots.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/time-slots"
version: "2026-11-09"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Time Slots

> A grid of the free times of one day, grouped by morning and afternoon. Booked times show struck through, and a person cannot pick them.

Page: https://gelatinui.com/components/time-slots

## When to use it

Best for: Picking one free time from a list that a booking API sends for one day.

- Use it after people pick a day, such as in a booking card.
- Use `disabled` on an item for a booked time. It keeps its place.
- Use `TimeSlotsGroup` to group times by part of the day.
- Use `TimeSlotsEmpty` for a day with no free time.

## When not to use it

- To type or pick any time of day, use a [Time Picker](https://gelatinui.com/components/time-picker.md).
- To pick the day first, use a [Week Strip](https://gelatinui.com/components/week-strip.md).

## Notes for agents

- Values are ISO time strings, such as `"09:30"`, not `Time` objects.
- To clear a controlled grid, set `value` to `""`.
- It is a Base UI RadioGroup, so `name`, `required`, and `form` work in a form.
- The locale sets the labels: en-US shows 9:30 AM and en-GB shows 09:30. `hourCycle` overrides it.
- `columns` takes 3, 4, or `auto`.

## Anatomy

```text
TimeSlots
├─ TimeSlotsGroup (0..n)
│  └─ TimeSlotsGroupLabel (0..n)
├─ TimeSlotsItem (0..n)
│  └─ TimeSlotsItemDescription (0..n)
└─ TimeSlotsEmpty (0..n)
```

## API reference

### TimeSlots

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `columns` | `"auto" \| 3 \| 4` | 3 |  |
| `size` | `"default" \| "lg" \| "sm"` | "default" |  |
| `className` | `string` |  |  |
| `hourCycle` | `HourCycle` |  | `12` shows "9:30 AM", `24` shows "09:30". With none, the locale decides (en-US 12, en-GB 24), as the Time Field does. The hour has two digits where the locale writes them ("09:30" in en-GB, "9:30" in ja-JP): `isHourPadded` in `lib/time-format`. |

Also takes every prop of Base UI `RadioGroup`: https://base-ui.com/react/components/radio-group

### TimeSlotsGroup

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### TimeSlotsGroupLabel

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### TimeSlotsItem

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `value` | `Value` |  | An ISO time, `"09:30"` or `"09:30:00"`. The label is formatted from it. |

Also takes every prop of Base UI `Radio.Root`: https://base-ui.com/react/components/radio

### TimeSlotsItemDescription

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### TimeSlotsEmpty

No props of its own: `className`, `children`, and every other prop go to the element it renders.

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| TimeSlots | `time-slots` |  | `--time-slots-empty-display` |  |
| TimeSlotsGroup | `time-slots-group` |  |  |  |
| TimeSlotsGroupLabel | `time-slots-group-label` |  |  |  |
| TimeSlotsItem | `time-slots-item` | `aria-invalid`, `data-booked`, `data-checked`, `data-disabled`, `data-readonly` | `--radius` | `motion-timing` |
| TimeSlotsItemDescription | `time-slots-item-description` | `data-booked`, `data-checked` |  |  |
| TimeSlotsEmpty | `time-slots-empty` |  | `--time-slots-empty-display` |  |

## Usage

Put the free times in groups for each part of the day. Add a description to a slot for its price or why it is taken.

```tsx title="haircut-times.tsx"
"use client";

import { useState } from "react";

import {
  TimeSlots,
  TimeSlotsGroup,
  TimeSlotsGroupLabel,
  TimeSlotsItem,
  TimeSlotsItemDescription,
} from "@/components/ui/pro/time-slots";

export function HaircutTimes() {
  const [time, setTime] = useState("14:00");
  return (
    <TimeSlots
      aria-label="Times on Friday, November 20"
      hourCycle={24}
      value={time}
      onValueChange={setTime}
    >
      <TimeSlotsGroup>
        <TimeSlotsGroupLabel>Morning</TimeSlotsGroupLabel>
        <TimeSlotsItem value="09:00" />
        <TimeSlotsItem value="10:00" disabled>
          <TimeSlotsItemDescription>Taken</TimeSlotsItemDescription>
        </TimeSlotsItem>
        <TimeSlotsItem value="11:00" />
      </TimeSlotsGroup>
      <TimeSlotsGroup>
        <TimeSlotsGroupLabel>Afternoon</TimeSlotsGroupLabel>
        <TimeSlotsItem value="14:00" />
        <TimeSlotsItem value="16:00">
          <TimeSlotsItemDescription>€40</TimeSlotsItemDescription>
        </TimeSlotsItem>
      </TimeSlotsGroup>
    </TimeSlots>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui-pro/time-slots
```

It adds 21 registry items: 18 files, 2610 lines, and the npm packages `@base-ui/react`, `@internationalized/date`, `clsx`, `react-aria-components`, `tailwind-merge`, `tailwind-variants`.

## Built on

- [Button](https://gelatinui.com/components/button.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Week Strip](https://gelatinui.com/components/week-strip.md)
- [Time Picker](https://gelatinui.com/components/time-picker.md)
- [Calendar](https://gelatinui.com/components/calendar.md)

## Motion

| Part | Motion |
| --- | --- |
| Press | press · the slot scales to 97% while pressed |
