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.
Set up the project
Run this once. It runs shadcn init if you have no components.json, then adds the Knowns UI registries.
Terminalnpx knowns-ui@latest initTerminalpnpm dlx knowns-ui@latest initTerminalyarn dlx knowns-ui@latest initTerminalbunx --bun knowns-ui@latest initAdd components
Name as many as you like in one call. The items they build on come with them.
Terminalnpx knowns-ui@latest add agent-graph button cardTerminalpnpm dlx knowns-ui@latest add agent-graph button cardTerminalyarn dlx knowns-ui@latest add agent-graph button cardTerminalbunx --bun 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
Next.js: create the project
Terminalnpx create-next-app@latest my-appNext.js: run init
Run it from the project root. It sets up shadcn when needed, then adds both Knowns UI registries to
components.json.Terminalnpx knowns-ui@latest initInteractive items start with
"use client", so you can import them from server pages.Next.js: load the stylesheet
shadcn writes your Tailwind setup to
app/globals.css. Make sure the entry file imports it, once.app/layout.tsximport "./globals.css"; export default function RootLayout({ children }: { children: React.ReactNode }) { return ( <html lang="en"> <body>{children}</body> </html> ); }Next.js: add components
Terminalnpx knowns-ui@latest add agent-graph button card
Vite: create the project
Terminalnpm create vite@latest my-app -- --template react-tsVite: run init
Run it from the project root. It sets up shadcn when needed, then adds both Knowns UI registries to
components.json.Terminalnpx knowns-ui@latest initshadcn sets the
@/alias intsconfigandvite.config. Keep the two in step.Vite: load the stylesheet
shadcn writes your Tailwind setup to
src/index.css. Make sure the entry file imports it, once.src/main.tsximport { createRoot } from "react-dom/client"; import "./index.css"; import App from "./App"; createRoot(document.getElementById("root")!).render(<App />);Vite: add components
Terminalnpx knowns-ui@latest add agent-graph button card
React Router: create the project
Terminalnpx create-react-router@latest my-appReact Router: run init
Run it from the project root. It sets up shadcn when needed, then adds both Knowns UI registries to
components.json.Terminalnpx knowns-ui@latest initMake sure Tailwind v4 scans
components/ui/knowns.React Router: load the stylesheet
shadcn writes your Tailwind setup to
app/app.css. Make sure the entry file imports it, once.app/root.tsximport "./app.css";React Router: add components
Terminalnpx 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.
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.Terminalnpx knowns-ui@latest init --cwd apps/web npx knowns-ui@latest add button --cwd apps/webCheck the aliases
Imports inside the items are rewritten to your aliases. Use
--pathto put the files somewhere else.apps/web/components.json{ "aliases": { "components": "~/components", "ui": "~/components/ui", "utils": "~/lib/utils" } }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 cardPaste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install Agent graph, Agent lanes, Button, Card from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/installation
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add agent-graph agent-lanes button card
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- lib/knowns/icons/actor-icon.tsx
- lib/knowns/icons/model-icons.tsx
- lib/knowns/icons/tool-icons.tsx
- lib/knowns/icons/model-icons.data.ts
- lib/knowns/icons/tool-icons.data.ts
- lib/knowns/icons/LICENSES.md
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/use-floating.ts
- components/ui/knowns/tooltip.tsx
- components/ui/knowns/tooltip-utils.ts
- components/ui/knowns/badge.tsx
- components/ui/knowns/spinner.tsx
- components/ui/knowns/button.tsx
- components/ui/knowns/agent-graph/agent-graph.tsx
- components/ui/knowns/agent-graph/detail-card.tsx
- components/ui/knowns/agent-graph/frame.ts
- components/ui/knowns/agent-graph/layout.ts
- components/ui/knowns/agent-graph/pulse-layer.tsx
- components/ui/knowns/agent-graph/radial.ts
- components/ui/knowns/agent-graph/routing.ts
- components/ui/knowns/agent-graph/tree.ts
- components/ui/knowns/agent-lanes/agent-lanes.tsx
- components/ui/knowns/card.tsx
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0, class-variance-authority@^0.7.1.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/installation, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "agent-graph" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.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.
Add an item
Terminalnpx shadcn@latest add @knowns-ui/buttonIf the project has no components.json yet, run
npx shadcn@latest initfirst. 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
| Path | What | Holds |
|---|---|---|
| components/ui/knowns/ | UI | Components and blocks, kept apart from your own shadcn components so nothing is overwritten. |
| lib/knowns/ | Core | utils.ts, types.ts, run.ts (the run store), status.ts and json.tsx. |
| lib/knowns/icons/ | Icons | Model and tool logos, actorIcon() and the licence notes for the logos. |
Troubleshooting
| Message | Cause | Fix |
|---|---|---|
| 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/knowns | The core item was skipped. | Run the add command again; it brings knowns-core. |
| Components have no styles | Tailwind 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 resolve | The alias is not set up. | Run shadcn init, or set the @/ path in tsconfig and your bundler. |
| Pro items need a license key | KNOWNS_LICENSE_KEY is not set. | Add it to your environment or .env.local. See Installing Pro. |