Ballmac UI home

Booking 1: class timetable

A weekly class timetable people book from: classes grouped by day, places left written out, one button that does the right thing (book, join the waiting list, cancel, leave), a kind filter, and changes undone with the reason if they fail.

State

The normal view. Pick a state to see what the block shows while it loads, is empty or fails.

Open in v0 (opens in a new tab)

Installation

$ pnpm dlx shadcn@latest add @ballmac/booking-1

Usage

Example: booking-1-demo.tsx
"use client"

import { Booking1 } from "@/components/ballmac/blocks/booking-1/booking-1"

export default function Booking1Demo() {
  return <Booking1 onChange={() => new Promise((r) => setTimeout(r, 400))} />
}

States

Pass state and the block does the rest: skeletons that match its layout, a clear empty message, an error you can retry, and announcements for screen readers.

  • Loading

    Skeleton day headings and cards under the real heading, announced as loading.

    state="loading"
  • No classes this week

    Says no classes this week; emptyState sets the copy.

    state="empty"
  • Could not load

    An alert saying nothing was booked or cancelled, with Try again (onRetry). A booking that fails is undone and says why.

    state="error"

Dependencies

Use with AI

A class timetable. <Booking1 classes={[{ id, title, kind, instructor, day: 'Mon 27 Oct', time: '07:00', length: '45 min', capacity, taken, booked?, waitlisted? }]} onChange={(class, 'book' | 'waitlist' | 'cancel' | 'leave') => Promise} />. Places left = capacity minus taken (minus you if booked); 3 or fewer says 'Only 2 places left', zero says 'Full' and offers the waiting list. Changes show at once and are undone if onChange rejects. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Booking 1: class timetable (@ballmac/booking-1) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • A studio, gym or workshop timetable with limited places
  • Any scheduled session where people can book, queue or cancel

Not for

  • A day schedule for staff and patients; use clinic-1
  • A calendar of events with tickets; use event-1

Registry JSON: https://ui.ballmac.com/r/booking-1.json

Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.