Free, MIT-licensed React components for AI chat and agent interfaces.
tuffui.com
·
Components
·
Installation
76 components for the parts of AI products generic UI kits don't cover: tool-call approvals, agent plans and traces, streaming chat, memory, usage meters, charts for agent data, and full screens built from them. They are distributed as a shadcn registry, so installing one copies its source into your project:
npx shadcn@latest add https://tuffui.com/r/tool-approval-queue.json
No Pro tier, no signup, nothing locked.
pnpm install
pnpm dev # http://localhost:3000
pnpm build # registry build (public/r) + next build
pnpm lint && pnpm typecheck && pnpm format:check
| Path | What |
|---|---|
registry/<name>/ |
Components: the single source of truth. demo.tsx and docs.ts hold each component's preview and docs. |
registry/use-mock-run/ |
Scripted runs that drive every preview. No component depends on it. |
lib/catalog.ts |
Component metadata: names, categories, variants. |
lib/site.ts |
Brand values: name, URL, GitHub. |
app/globals.css |
Theme tokens. The registry theme item is generated from this file. |
scripts/build-registry.mts |
Writes registry.json, then runs shadcn build into public/r/. |
- Create
registry/<slug>/<slug>.tsx,demo.tsxanddocs.ts. Start the component file with the two license lines every component has; the registry build fails without them. - Add an entry to
lib/catalog.ts. - Import shared primitives as
@/components/ui/<name>and motion values from@/lib/motion-tokens. The registry build reads each file's imports and fills in npm and registry dependencies on its own. - Register the demo in
components/docs/demo.tsxand the docs inlib/docs/index.ts.
Screens are whole app screens composed from components (shadcn registry:block). They
preview in a device frame (1280 / 768 / 390) on /components/<slug> and render alone at
/screens/<slug>.
- Same files as a component:
registry/<slug>/<slug>.tsx,demo.tsx,docs.ts, a catalog entry withcategory: "screens", and the demo/docs registrations. - Import components only as
@/components/ui/<slug>(shims exist for all of them). Dependencies are read from the screen file and its demo, so the components the demo renders as content come along on install. - The root fills its parent (
h-full w-full) and is a@container. Lay out with container queries (@md:,@4xl:…), never viewport breakpoints, so each device width in the frame shows its own layout. - Scrolling: one vertical scroll for the main content (the thread). No nested scroll
areas inside messages or panels. A composer stays pinned at the bottom over the
content —
ChatThread barewithbottomInsetset to the composer's measured height. A sidebar may scroll only when it is taller than the screen. - Nothing scrolls sideways at any width: chips and tags wrap, long text truncates or
wraps, payloads wrap. Overlays (drawers) stay inside the screen instead of portalling
to the page. Check: no element with
overflow-x: auto | scrollandscrollWidth > clientWidth, and nothing visible outside the screen box.
MIT. Free for personal and commercial use; keep the license line at the top of each file. If TUFFUI saves you time, you can support it on Ko-fi.