Skip to content

Installation

Terminal window
npm install trud-calendar
# or
pnpm add trud-calendar
# or
yarn add trud-calendar

Peer dependencies: react >=18, react-dom >=18

Using an AI coding agent? Install the Agent Skill so your AI knows the full trud-calendar API — every prop, slot, hook, and pattern:

Terminal window
npx skills add trudapp/trud-calendar

Works with Claude Code, Cursor, Copilot, Cline, Codex, and 40+ more agents.

Import the theme variables before Tailwind, and add the @source directive so Tailwind generates the required utility classes:

@import "trud-calendar/styles.css";
@import "tailwindcss";
@source "../node_modules/trud-calendar/dist";

If you’re not using Tailwind, just import the pre-built CSS file:

@import "trud-calendar/styles.css";

Or in your JavaScript entry:

import "trud-calendar/styles.css";

If your project uses shadcn v2, the calendar inherits your theme automatically. The CSS variables fall back to shadcn’s var(--background), var(--foreground), etc.

Just add the @source directive and import the styles:

@import "trud-calendar/styles.css";
@import "tailwindcss";
@source "../node_modules/trud-calendar/dist";

shadcn v1 defines CSS variables as raw HSL numbers (e.g. --border: 214.3 31.8% 91.4%), which are not valid CSS colors on their own. You’ll need to map them manually with hsl() wrappers. See the Theming > shadcn v1 section for the full snippet.