API reference

tailwind

Every export of @kitr/tailwind, @kitr/tailwind/vite, read from the published type definitions. The guide shows them in use.

@kitr/tailwind

Re-exports clsx, tailwind-merge unchanged, plus the following.

cn

function cn(...inputs: ClassValue[]): string;

Join class names and drop the Tailwind classes a later one overrides: clsx plus tailwind-merge, as in shadcn. Put a component's className prop last so callers can override its defaults.

defineConfig

const defineConfig: <const C extends TailwindConfig>(config: C) => C;

Types config/tailwind.ts against TailwindConfig and returns the object unchanged.

TailwindConfig

interface TailwindConfig {
  /** Entry stylesheet relative to the project root. Default `app/styles/app.css`. `kitr doctor` checks it exists and imports Tailwind. */
  entry?: string;
  /** Use kitr's preset (`@kitr/tailwind/preset.css`). Default true. `kitr doctor` checks the entry imports it exactly when this is on. */
  preset?: boolean;
}

Options of config/tailwind.ts: how the project's stylesheet is set up. The build reads the CSS itself; kitr doctor checks the two agree.

@kitr/tailwind/vite

kitrTailwind

function kitrTailwind(): Plugin[];

Tailwind v4 for kitr apps. Exactly @tailwindcss/vite, exposed here so kitr add tailwind has one import to write and one version to manage.