01getting started

Installation

Two ways in — the npm package, or the source registry that lands the whole calendar in your repo.

kloq ships two ways. npm gives you the compiled, typed build. The source registry copies the whole calendar — engine, views, themes, design mode — into your repo as licensed source you can edit, through one shadcn CLI command. Same component, same API; the difference is whether the code lives in node_modules or in your tree.

npm — the compiled build

terminal
npm install kloq

react ≥ 19 and Tailwind CSS v4 are assumed. Import the stylesheet once, in your root layout — CSS imported inside a page or component only reaches that route:

app/layout.tsx
import "kloq/styles.css";
ImportNotes
kloqThe <Kloq> component, chrome parts, types, store helpers, the command registry, quick add, ICS.
kloq/themesThe theme system: setTheme / setScheme, and the pre-paint restore script for zero-flash SSR.
kloq/settingsThe optional preferences dialog and its KloqPreferences model.
kloq/design-modeThe ⌥D design-mode surface, importable on its own.
kloq/styles.cssThe single stylesheet. Import once.

Registry — edit the source

The registry delivers the same calendar as source files under components/kloq/, so a custom slot is just another file and a spring tweak is a line you can edit. Use is governed by the Kloq Source License. Source access comes with a registry token — join the waitlist for yours (KLOQ_REGISTRY_TOKEN in .env.local); point the CLI at kloq once:

components.json
{
  "registries": {
    "@kloq": {
      "url": "https://kloq.dev/r/{name}.json",
      "headers": { "Authorization": "Bearer ${KLOQ_REGISTRY_TOKEN}" }
    }
  }
}
terminal
npx shadcn@latest add @kloq/kloq

The CLI lands the library under components/kloq/ and installs its five npm dependencies (@base-ui/react, class-variance-authority, clsx, lucide-react, tailwind-merge). Import paths change from kloq/... to @/components/kloq/...:

app/layout.tsx
import "@/components/kloq/styles/kloq.css";
ImportTypeNotes
@/components/kloqcomponent + APIEverything the kloq npm entry exports.
@/components/kloq/lib/themestheme systemkloq/themes.
@/components/kloq/settingssettings dialogkloq/settings.
@/components/kloq/design-modeinspectorkloq/design-mode.
@/components/kloq/styles/kloq.cssstylesheetkloq/styles.css.

Light and dark

kloq follows a dark class on <html> — the coss / shadcn convention — and leaves that class alone unless you call setScheme. If your app runs no scheme convention at all (no dark or light class on <html>), the calendar follows the OS on its own, scoped to itself, so it never paints white on a dark page.

Requirements

React 19+, Tailwind CSS v4, a browser with pointer events and WAAPI (every evergreen browser), and a container with a real height — <Kloq> is h-full and renders into whatever box you give it. There is no window-level layout: two calendars on one page work fine.

on this page