Skip to content

Installation

Add Knowns UI to a React project with one command. Every item lands in your repo as source code you can change.

On this page

Requirements

React 19 and Tailwind CSS v4. TypeScript is recommended. Next.js, Vite and React Router all work.

Free items are open source (MIT) on GitHub.

Quick start

The knowns-ui command wraps the shadcn CLI. It sets up components.json when it is missing, sends each name to the Free or the Pro registry, and passes shadcn flags such as -y and --path through.

  1. Set up the project

    Run this once. It runs shadcn init if you have no components.json, then adds the Knowns UI registries.

    Terminal
    npx knowns-ui@latest init
  2. Add components

    Name as many as you like in one call. The items they build on come with them.

    Terminal
    npx knowns-ui@latest add agent-graph button card

knowns-ui list shows every item with its tier, knowns-ui search finds one, and --dry-run prints the shadcn command without running it.

knowns-ui skill teaches your coding agent how to find, install and compose Knowns UI: it writes a skill to .claude/skills/knowns-ui and a section in AGENTS.md, and --client all adds Cursor, Copilot, Windsurf and Codex.

Already using shadcn?

Run npx knowns-ui@latest init, then add. On a project with a components.json, init does not run shadcn again and does not touch your style, aliases or other registries. It only adds the two Knowns UI registries, and running it twice changes nothing.

Files land in components/ui/knowns and lib/knowns, beside your own, so your components/ui/button.tsx is never replaced.

Your theme stays as it is. Items read your tokens (--primary, --muted and the rest) and add only --kn-* variables and kn-* keyframes.

A registry named @knowns-ui that already points elsewhere is kept with a warning. init --force replaces it.

Framework guides

  1. Next.js: create the project

    Terminal
    npx create-next-app@latest my-app
  2. Next.js: run init

    Run it from the project root. It sets up shadcn when needed, then adds both Knowns UI registries to components.json.

    Terminal
    npx knowns-ui@latest init

    Interactive items start with "use client", so you can import them from server pages.

  3. Next.js: load the stylesheet

    shadcn writes your Tailwind setup to app/globals.css. Make sure the entry file imports it, once.

    app/layout.tsx
    import "./globals.css";
    
    export default function RootLayout({ children }: { children: React.ReactNode }) {
      return (
        <html lang="en">
          <body>{children}</body>
        </html>
      );
    }
  4. Next.js: add components

    Terminal
    npx knowns-ui@latest add agent-graph button card

Any React 19 and Tailwind v4 setup works, as long as components.json points at your stylesheet and your import alias.

Monorepos and custom aliases

The CLI follows your components.json, so nothing extra is needed. Run it against the package that renders the components, and let its aliases decide the import paths.

  1. Run it from the package

    Go to the app or package folder, or point the commands at it with --cwd. The flag goes to shadcn as it is.

    Terminal
    npx knowns-ui@latest init --cwd apps/web
    npx knowns-ui@latest add button --cwd apps/web
  2. Check the aliases

    Imports inside the items are rewritten to your aliases. Use --path to put the files somewhere else.

    apps/web/components.json
    {
      "aliases": {
        "components": "~/components",
        "ui": "~/components/ui",
        "utils": "~/lib/utils"
      }
    }
  3. Let Tailwind see the files

    If the items live in a shared package, add its folder as a source in the stylesheet that each app imports.

    apps/web/app/globals.css
    @import "tailwindcss";
    @source "../../../packages/ui/src";

Add a component

The command below is the same as the Quick start, in the package manager you pick. Manual lists the files to copy, and With AI gives your coding agent one prompt that does it all.

npx knowns-⁠ui@latest add agent-⁠graph agent-⁠lanes button card
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.
components/agent-view.tsx
import { useAgentRun } from "@/lib/knowns/run";
import { AgentGraph } from "@/components/ui/knowns/agent-graph/agent-graph";
import { Button } from "@/components/ui/knowns/button";

export function AgentView() {
  const run = useAgentRun();
  // Emit events wherever your agents report progress: run.emit({ type: "span.start", ... })
  return (
    <>
      <AgentGraph run={run} />
      <Button onClick={() => run.emit({ type: "reset" })}>Reset</Button>
    </>
  );
}

Fallback: the shadcn CLI alone

Use this only if the knowns-ui CLI can’t run, for example with no network to npm or an older setup. The @knowns-ui namespace is built into the shadcn CLI, so you add Free items by name with nothing to set up in components.json. The files are the same.

  1. Add an item

    Terminal
    npx shadcn@latest add @knowns-ui/button

    If the project has no components.json yet, run npx shadcn@latest init first. On an older shadcn CLI that does not know the namespace, add by URL instead: npx shadcn@latest add https://ui.knowns.dev/r/button.json.

Pro

Pro items install from a licensed registry. Add your key, then use the same command: npx knowns-ui@latest add agent-board. Setup, keys and CI are on Installing Pro.

Dark mode and colours

Dark mode follows a .dark class on <html>, as in any shadcn project, so no theme provider is needed. Use your own toggle, or add the Theme Toggle. Tokens, accents and status colours are on Theming and Variants & colours.

Where files go

PathWhatHolds
components/ui/knowns/UIComponents and blocks, kept apart from your own shadcn components so nothing is overwritten.
lib/knowns/Coreutils.ts, types.ts, run.ts (the run store), status.ts and json.tsx.
lib/knowns/icons/IconsModel and tool logos, actorIcon() and the licence notes for the logos.

Troubleshooting

MessageCauseFix
Unknown registry "@knowns-ui"An older shadcn CLI does not list the namespace.Update the shadcn CLI (npx shadcn@latest), or add by URL: npx shadcn@latest add https://ui.knowns.dev/r/<name>.json.
Cannot find module under lib/knownsThe core item was skipped.Run the add command again; it brings knowns-core.
Components have no stylesTailwind does not scan the folder.Check that components/ui/knowns is inside a path Tailwind v4 scans (add an @source if not).
Import alias @/ does not resolveThe alias is not set up.Run shadcn init, or set the @/ path in tsconfig and your bundler.
Pro items need a license keyKNOWNS_LICENSE_KEY is not set.Add it to your environment or .env.local. See Installing Pro.

Need help?

Stuck on Installation, or found something off? We read every message.