Components
Day View
One day on the time grid.
Day View shows a single day on the Time Grid, with the same drag, resize and create interactions as the week view. Rendered on its own, it sets the provider's view to "day", so prev/next, T and the header step by one day.
Installation
pnpm dlx shadcn add @calendarcn/day-viewUsage
import { CalendarProvider } from "@/components/calendar-provider";
import { DayView } from "@/components/day-view";
export function Today() {
return (
<CalendarProvider defaultEvents={events}>
<div className="h-[600px]">
<DayView scrollToHour={8} />
</div>
</CalendarProvider>
);
}API Reference
DayView
Everything else (date, events, hours, clock, locale) is set on CalendarProvider.
| Prop | Type | Default |
|---|---|---|
showEventPopoverWhether the selected event opens a details popover beside it. Turn it off when the details are shown elsewhere, such as a side panel. | boolean | true |
onEventPopoverExpandCalled by the popover's expand button, e.g. to move the details into a side panel. The button is hidden when this is not set. | () => void | – |
scrollToHourHour the grid scrolls to when it mounts, e.g. 8 for 8 AM or 8.5 for 8:30. Applied once and clamped to the provider's dayStartHour..dayEndHour. Unset starts at the top. | number | – |
classNameClasses for the root element. | string | – |