nook
Browse the docs

Components

Schedule

Built on Base UI

Events in a local-time day, week, month, or year. Overlapping meetings share the available width.

See the prompt

Nov 16 – Nov 22, 2026

Local
16 Mon
17 Tue
18 Wed
19 Thu
20 Fri
21 Sat
22 Sun
All day
12:00 AM
1:00 AM
2:00 AM
3:00 AM
4:00 AM
5:00 AM
6:00 AM
7:00 AM
8:00 AM
9:00 AM
10:00 AM
11:00 AM
12:00 PM
1:00 PM
2:00 PM
3:00 PM
4:00 PM
5:00 PM
6:00 PM
7:00 PM
8:00 PM
9:00 PM
10:00 PM
11:00 PM

Use arrow keys to move between days or hours. Press Enter to choose.

A week at the product studio.

Installation

npx nook-ui@latest add schedule

Prompt

Paste this into your AI coding assistant. It adds this exact component, the same way the CLI does, and tells the assistant how to use it.

Short. For assistants that can run commands in your project.

Plain text
Add the Nook "Schedule" component to this project, exactly as Nook ships it.

Events in a local-time day, week, month, or year. Overlapping meetings share the available width.

Steps
1. Check for `nook.json` in the project root. If it is missing, run `npx nook-ui@latest init` first (React or Next.js with Tailwind CSS v4). It adds the Nook tokens, the theme and `cn()`.
2. Run `npx nook-ui@latest add schedule`. It writes `components/ui/schedule.tsx` together with everything the component needs. Do not write the component from memory.
3. If you cannot run commands, fetch http://localhost:3000/r/schedule.json, write every entry of `files` to the path it names, install the packages in `dependencies`, and repeat for each name in `registryDependencies`.
4. Use it where I ask. Start from this example:

```tsx
"use client";

import * as React from "react";
import { Schedule, type ScheduleEvent } from "@/components/ui/schedule";

const events: ScheduleEvent[] = [
  { id: "planning", title: "Plan the release", start: "2026-11-16T09:00:00", end: "2026-11-16T10:00:00", location: "Studio A" },
  { id: "research", title: "Customer interviews", start: "2026-11-16T09:30:00", end: "2026-11-16T11:00:00", tone: "muted" },
  { id: "review", title: "Design review", start: "2026-11-17T10:00:00", end: "2026-11-17T11:00:00", location: "Studio B" },
  { id: "focus", title: "Writing time", start: "2026-11-18T13:00:00", end: "2026-11-18T15:00:00", tone: "accent" },
  { id: "demo", title: "Product demo", start: "2026-11-19T14:00:00", end: "2026-11-19T15:00:00" },
  { id: "launch", title: "Release day", start: "2026-11-20T00:00:00", end: "2026-11-21T00:00:00", allDay: true },
  { id: "offsite", title: "Team offsite", start: "2026-12-09T00:00:00", end: "2026-12-11T00:00:00", allDay: true },
  { id: "retro", title: "Quarterly reflection", start: "2026-09-25T14:00:00", end: "2026-09-25T16:00:00" },
];
export default function ScheduleDefault() {
  const [message, setMessage] = React.useState("A week at the product studio.");
  return <div className="grid w-full min-w-0 gap-4"><Schedule aria-label="Product studio schedule" defaultDate={new Date(2026, 10, 16)} today={new Date(2026, 10, 16, 10, 30)} events={events} onEventSelect={(event) => setMessage(`${event.title}${event.location ? ` Ā· ${event.location}` : ""}`)} onSlotSelect={(start) => setMessage(`Selected ${new Date(start).toLocaleString("en-US", { dateStyle: "medium", timeStyle: "short" })}.`)} /><p role="status" className="text-xs text-muted-foreground">{message}</p></div>;
}
```

API
- `Schedule`: A calendar with its toolbar. Event end times are exclusive. Use ISO datetimes with offsets to identify instants; display follows the viewer’s local zone.
  - `events` (`ScheduleEvent[]`): Each event has id, title, start, end, optional allDay, tone (brand, muted, accent), and location.
  - `view, defaultView` (`"day" | "week" | "month" | "year"`, default week): Controlled view, or the first view.
  - `date, defaultDate` (`Date`): Controlled anchor day, or the first day. Without either, waits until mount to read today.
  - `today` (`Date`): Clock for today and the current-time line. Useful for deterministic rendering.
  - `onViewChange, onDateChange` (`(view: ScheduleView) => void, (date: Date) => void`): Called by navigation and when a year or month day opens the day view.
  - `onEventSelect` (`(event: ScheduleEvent) => void`): Open event details in your app.
  - `onSlotSelect` (`(start: string, end: string) => void`): Receives a one-hour slot as ISO instants.
  - `weekStartsOn, locale` (`0 | 1, string`, default 1, en-US): Sunday or Monday first, and the locale for labels.
- `ScheduleToolbar`: Previous, today, next, the range title and a ToggleGroup view switcher; also usable separately.
  - `date, view, onDateChange, onViewChange` (`Date, ScheduleView, callbacks`): The current range and navigation handlers.
  - `today, weekStartsOn, locale` (`Date, 0 | 1, string`): Same display settings as Schedule.
- Variant `view`: day, week, month, year (default week)

Rules
- Colors, radii, shadows and motion come from Nook tokens and classes such as `bg-primary`, `text-muted-foreground`, `border-border`, `rounded-lg` and `h-control`. Never hard-code them.
- Do not restyle or simplify the file. Change how it looks through `className`, its props and the theme.
- It must keep working with the keyboard, in light and dark mode, and in the sharp, soft and bold styles.
- Accessibility: Arrow keys move between days and hours. Enter chooses a day or slot; event buttons announce their full time range and location. The week scrolls with a sticky time column. Today is read after mount unless supplied.

Done when the component renders like the example in light and dark mode and the project type-checks.

Usage

"use client";

import * as React from "react";
import { Schedule, type ScheduleEvent } from "@/components/ui/schedule";

const events: ScheduleEvent[] = [
  { id: "planning", title: "Plan the release", start: "2026-11-16T09:00:00", end: "2026-11-16T10:00:00", location: "Studio A" },
  { id: "research", title: "Customer interviews", start: "2026-11-16T09:30:00", end: "2026-11-16T11:00:00", tone: "muted" },
  { id: "review", title: "Design review", start: "2026-11-17T10:00:00", end: "2026-11-17T11:00:00", location: "Studio B" },
  { id: "focus", title: "Writing time", start: "2026-11-18T13:00:00", end: "2026-11-18T15:00:00", tone: "accent" },
  { id: "demo", title: "Product demo", start: "2026-11-19T14:00:00", end: "2026-11-19T15:00:00" },
  { id: "launch", title: "Release day", start: "2026-11-20T00:00:00", end: "2026-11-21T00:00:00", allDay: true },
  { id: "offsite", title: "Team offsite", start: "2026-12-09T00:00:00", end: "2026-12-11T00:00:00", allDay: true },
  { id: "retro", title: "Quarterly reflection", start: "2026-09-25T14:00:00", end: "2026-09-25T16:00:00" },
];
export default function ScheduleDefault() {
  const [message, setMessage] = React.useState("A week at the product studio.");
  return <div className="grid w-full min-w-0 gap-4"><Schedule aria-label="Product studio schedule" defaultDate={new Date(2026, 10, 16)} today={new Date(2026, 10, 16, 10, 30)} events={events} onEventSelect={(event) => setMessage(`${event.title}${event.location ? ` Ā· ${event.location}` : ""}`)} onSlotSelect={(start) => setMessage(`Selected ${new Date(start).toLocaleString("en-US", { dateStyle: "medium", timeStyle: "short" })}.`)} /><p role="status" className="text-xs text-muted-foreground">{message}</p></div>;
}

Variants

Defined in one place with cva, at the top of the component file.

  • view

    dayweek (default)monthyear

Props

Schedule

A calendar with its toolbar. Event end times are exclusive. Use ISO datetimes with offsets to identify instants; display follows the viewer’s local zone.

PropTypeDefaultDescription
eventsScheduleEvent[]–Each event has id, title, start, end, optional allDay, tone (brand, muted, accent), and location.
view, defaultView"day" | "week" | "month" | "year"weekControlled view, or the first view.
date, defaultDateDate–Controlled anchor day, or the first day. Without either, waits until mount to read today.
todayDate–Clock for today and the current-time line. Useful for deterministic rendering.
onViewChange, onDateChange(view: ScheduleView) => void, (date: Date) => void–Called by navigation and when a year or month day opens the day view.
onEventSelect(event: ScheduleEvent) => void–Open event details in your app.
onSlotSelect(start: string, end: string) => void–Receives a one-hour slot as ISO instants.
weekStartsOn, locale0 | 1, string1, en-USSunday or Monday first, and the locale for labels.

ScheduleToolbar

Previous, today, next, the range title and a ToggleGroup view switcher; also usable separately.

PropTypeDefaultDescription
date, view, onDateChange, onViewChangeDate, ScheduleView, callbacks–The current range and navigation handlers.
today, weekStartsOn, localeDate, 0 | 1, string–Same display settings as Schedule.

Accessibility

Arrow keys move between days and hours. Enter chooses a day or slot; event buttons announce their full time range and location. The week scrolls with a sticky time column. Today is read after mount unless supplied.

Checked against WCAG 2.1 AA with automated axe tests and keyboard tests on every release.