Hatch's shadcn registry
On this page
Hatch's board, chat, search, editor and grid as shadcn components: the code lands in your project, you own it, and it reads and writes a Hatch vault (plain Markdown notes that agents, sync and Obsidian share).
pnpm dlx shadcn add @hatchmd/board @hatchmd/chat @hatchmd/editor @hatchmd/grid @hatchmd/searchnpx shadcn add @hatchmd/board @hatchmd/chat @hatchmd/editor @hatchmd/grid @hatchmd/searchyarn dlx shadcn add @hatchmd/board @hatchmd/chat @hatchmd/editor @hatchmd/grid @hatchmd/searchbunx --bun shadcn add @hatchmd/board @hatchmd/chat @hatchmd/editor @hatchmd/grid @hatchmd/searchThe grid needs
@hatchmd/app, which isn't on npm (the app is built with Vite). Inside this repo it works as is (apps/shadcn-demo). The other items install from npm.
Set up
Tell shadcn where the @hatchmd items are, in components.json:
{
"registries": {
"@hatchmd": "https://<your Hatch host>/r/{name}.json"
}
}
Every Hatch web build serves the registry at /r/ (apps/web/public/r).
Then put the vault around the part of your app that uses it:
import { HatchVault } from '@/components/hatch/hatch-vault'
import { Board } from '@/components/hatch/board'
<HatchVault me="Alex">
<Board project="Website" />
</HatchVault>
HatchVault keeps the vault in the browser's own storage, apart from Hatch's own web app vault, and starts it with a small team workspace. vaultKey keeps two apps on one site apart. To open a folder, a server vault or anything else, use HatchProvider from @hatchmd/react with your own Vault (see react.md).
The items
| Item | What you get | Built on |
|---|---|---|
@hatchmd/hatch-vault | HatchVault: a vault in the browser, with Hatch's hooks in reach. The others need it | @hatchmd/react |
@hatchmd/board | <Board project="Website" />: columns by status, drag to move, add at the foot of a column. Moves show in other tabs at once | useBoard |
@hatchmd/chat | <Chat channel="general" />: messages, who's typing, older days | useChannel |
@hatchmd/search | <VaultSearch onPick={(path) => ...} />: tasks by id, status, assignee or label, then full text | useVaultSearch |
@hatchmd/editor | <Editor value={md} onChange={setMd} />: Hatch's Markdown editor, unchanged blocks byte for byte | @hatchmd/editor/react |
@hatchmd/grid | <Grid csv={text} onChange={save} />: a million-row CSV opens as fast as ten rows; select, copy, paste, edit, sort, filter | @hatchmd/app/grid |
Each item also gives the AI built into the browser its own tools while it's on screen (WebMCP): board_read, board_add_card and board_move_card, chat_read and chat_post, search_vault and open_result, editor_read and editor_edit. The agent calls them instead of reading the page and clicking. With two of one kind on a page, give each an agentName (<Board project="Website" agentName="website_board" />). See webmcp.md.
The board, chat and search use Tailwind classes and shadcn's tokens (bg-card, text-muted-foreground, ring-ring), so they take your theme. The editor and grid draw Hatch's own controls; shadcnTokens (in hatch-theme.ts, installed with them) points Hatch's color tokens at yours, dark mode included. Their styles name only Hatch's own classes, so the rest of your page is untouched.
Working on it
- The components are in
apps/registry/src/hatch, listed inapps/registry/registry.json. - After changing one, run
pnpm --filter @hatch/registry build. It writesapps/web/public/r, andapps/registry/src/registry.test.tsfails while that's out of date. apps/shadcn-demois a shadcn app using all of them on one vault (pnpm --filter @hatch/shadcn-demo dev, port 5185;?as=Samin a second tab to be someone else).scripts/e2e-shadcn.pychecks it.?show=board,chat,?rows=1000000,?title=and?about=trim it for recordings, andpython3 scripts/demo-videos.py <folder>records the short demo videos (two people live on one board and chat, and a million-row grid) as MP4s. With--agentit also records a real model, through the AI SDK with the vault as memory, turning a standup into cards and a chat post (src/agent/server.ts, which also runs on its own withpnpm --filter @hatch/shadcn-demo agent-demo; it needsANTHROPIC_API_KEYorAI_GATEWAY_API_KEY).