Installation
$ pnpm dlx shadcn@latest add @synccn/week-scheduleFirst time in this project? Connect synccn with one command.
Usage
import { WeekSchedule } from "@/components/ui/week-schedule";<WeekSchedule events={events} />API reference
Generated from the component's TypeScript types, so it always matches the code.
WeekSchedule
Week view calendar. events: [{ day: 0–6 (Mon–Sun), start: 9.5, end: 11, title, tone? }] Shows a live "now" line on today's column.
- eventsrequired
ScheduleEvent[]Events to place.
- startHour
numberDefault
8First hour shown.
- endHour
numberDefault
18Last hour shown.
- hourHeight
numberDefault
44Pixels per hour.
- days
string[]Default
["Mon", "Tue", "Wed", "Thu", "Fri"]Column labels.
- onEventClick
(event: ScheduleEvent) => voidCalled when an event is clicked.
- className
stringExtra classes for the root element.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
npm packages
- clsx for cn()
- tailwind-merge for cn()
Accessibility
From the source
Read from this component's code when the site builds, so it can't drift.
No ARIA roles, key handling or motion settings in its source. It renders plain elements, so its accessibility comes from the content and labels you give it.