shadcn examples svg logo
484

Command Palette

Search for a command to run...

Sign inGet All Access

Shadcn Calendar With Sidebar

Event Calendar With Sidebar is a full-page calendar block that pairs a month view with the official Shadcn UI sidebar-12 layout: a collapsible sidebar holding a date picker, checkbox calendar lists, a user menu, and a New Calendar action. Every control is wired up: toggling a calendar filters the colored event chips in the month grid, the sidebar date picker and the header arrows drive the visible month, clicking a day selects it, and the New Calendar dialog adds a working calendar with its own color. Built from Shadcn UI components with Tailwind classes, light and dark mode ready, responsive down to phones. Use it in React, or take the matching Vuejs or Svelte version.

Pro
Event Calendar With Sidebar preview
Get Unlimited Access to All Examples & Blocks.
Unlock everything with a single payment. Get lifetime access to all content. You will also receive free access to all new examples.

Two Calendars, One Screen

This block combines two calendar surfaces that stay in sync. The content area renders a classic month grid: seven columns, six rows, a highlighted today marker, and colored event chips with times and titles. The sidebar carries a compact date picker plus grouped calendar lists, following the structure of the official sidebar-12 block from the Shadcn UI examples, with a user menu on top and a New Calendar button pinned to the footer.

Because both surfaces share the same state, moving around feels like a real calendar app. Change the month in the sidebar picker and the grid follows, page through months with the header arrows and the picker follows back, and click any day in either place to select it everywhere.

Checkboxes That Actually Filter

The sidebar lists calendars in three collapsible groups, My Calendars, Favorites, and Other, each row with a checkbox and a color dot. These are not decorative: unchecking Work instantly removes every Work event chip from the month grid, and checking Family brings its events back. The active set lives in React state, so the filter logic is a single array filter you can trace in seconds.

Colors travel with the data. Each calendar carries a color key, emerald for Personal, blue for Work, amber for Holidays and so on, and both the sidebar dots and the event chips read from one shared map of Tailwind classes with dark mode variants baked in.

The New Calendar Dialog

The New Calendar button in the sidebar footer opens a small dialog with a name input and a row of selectable color swatches. Creating a calendar appends it to the My Calendars group, already checked, and any events assigned to it would immediately render in its color. It is a compact pattern for list plus create flows that you can reuse far beyond calendars.

The dialog is a stock Shadcn UI Dialog with an Input, Labels, and two Buttons, so restyling it or swapping the color picker for your own component is straightforward.

Responsive Behavior and Theming

On wide screens each day cell shows up to three labeled chips plus a +N more line. The grid watches its own width with container queries, so when space runs out the chips collapse into small colored dots and the day numbers center themselves, keeping the month readable on a phone. The sidebar itself is the collapsible Shadcn UI sidebar, sliding over the content on mobile behind the trigger button in the header.

Styling stays inside the design token system: sidebar surfaces use the sidebar tokens, the grid uses border, muted, and accent, and only the per-calendar colors reach for the Tailwind palette. Dark mode works out of the box in both the grid and the chips.

Using the Block in Your Project

Copy the code from the Code tab or install the block with the shadcn CLI, then feed it your own events. The demo keeps events, calendar groups, and the user in one JSON file, where each event is a day of month, a calendar name, a title, and an optional time, which makes swapping in an API response trivial.

If you need drag and drop scheduling, week and day views, or an event editing dialog, the fuller event calendar block covers that scope. The same sidebar calendar block also exists for Vuejs on shadcn-vue and for Svelte on shadcn-svelte, sharing the layout and interactions across all three frameworks.

Frequently Asked Questions

Is this Shadcn calendar block free?
The live preview is free for everyone. The source code and the shadcn CLI install are available on the Pro plan, matching the other event calendar block on the site.
How is this different from the main event calendar block?
The main event calendar focuses on views and editing: month, week, day, and agenda modes with drag and drop. This block focuses on the app shell: a sidebar with a date picker and calendar filters wrapped around a clean month grid, closer to how Google Calendar or Apple Calendar frame the page.
Do the sidebar checkboxes really filter the events?
Yes. Each checkbox toggles a calendar in React state and the month grid filters its event list against the active set, so chips appear and disappear instantly. The New Calendar dialog and the month navigation are wired the same way.
Does it use the official sidebar-12 block from Shadcn UI?
The sidebar follows the sidebar-12 structure, a date picker, collapsible checkbox groups, a user dropdown, and a footer action, but the pieces are connected to real state instead of being static, and the content area is a functional month calendar rather than placeholder boxes.
Can I get this calendar for Vuejs or Svelte?
Yes. The same block is published for Vuejs on shadcn-vue and for Svelte on shadcn-svelte with the same sidebar filters, month grid, and dialog.