The component layer for spec-driven UI.
Every component ships with a machine-readable spec — when to use it, when not to, common mistakes, accessibility notes, token budget. Hand your agent a brief; Hex UI resolves it to a ranked component checklist over MCP.
Edit your theme against real product surfaces
Token edits feel right when you can see them on a working form, a chart, a list of transactions — not on a swatch grid.
Live, not mocked
Drag color tokens, density, and radius — every product surface in the canvas re-paints in one frame against the actual @hex-core/components bundle.
Per-mode overrides
Light AND dark in one URL — share a link and your collaborator sees the exact theme you're editing, with both palettes intact.
Copy for LLM
One click → the canonical buildAppContext markdown (the same blob the MCP emit_app_context tool emits). Paste into Claude or ChatGPT and the agent has your full stack.
Payout Threshold
Minimum balance before a payout is triggered.
Every component teaches the agent what to do
Every JSON in the registry carries a structured AI block — not just docs, not just types, but the things the agent needs to choose.
When an agent has to pick a component, it's usually choosing between three or four candidates that all look right by name. Hex UI ships a structured ai block on every registry item — not docs, not types, but the things that actually drive the choice.
The agent reads it once, then ranks. No training-data guesswork, no hallucinated props. The same blob is what powers MCP search, the /llms-full.txt bundle, and Studio's "Copy for LLM" payload — one canonical schema, four surfaces.
whenToUsestring- What the component is for. The agent reads this before it picks Outline vs Default — not training-data guesswork.
whenNotToUsestring- What the component is NOT for. Stops the agent from grabbing a Button when it really wants a Link.
commonMistakesstring[]- Foot-guns the LLM should self-correct before review does. Shipped, not assumed.
tokenBudgetinteger- Approximate context cost. MCP search ranks by what fits in the context window, not just by name match.
{
"whenToUse": "Use for clickable actions: form submissions, confirmations, triggering operations. Use 'default' variant fo…",
"whenNotToUse": "Don't use for navigation between pages (use Link or anchor with asChild). Don't use 'destructive' for non-d…",
"commonMistakes": [
"Nesting interactive elements inside asChild button",
"Using <Button> with plain onClick for navigation instead of <Button asChild><a href=...></a></Button> — bre…",
"Using <Button variant='destructive'> for recoverable actions like 'Reset filters' — reserve destructive for…"
],
"accessibilityNotes": "Automatically handles focus ring, disabled state, and aria attributes. Icon-only buttons MUST have aria-lab…",
"tokenBudget": 500
}Plug it into Claude Code or Cursor
The Hex UI MCP server exposes the registry as structured tool calls. Component discovery is one tool call away — not hundreds of tokens of doc reading.
{
"mcpServers": {
"hex-ui": {
"command": "npx",
"args": ["@hex-core/mcp"]
}
}
}search_componentsBrief or tag → ranked component list with descriptions and dependencies.
get_component_schemaPull props, variants, slots, and AI hints for one component without fetching its source.
resolve_specNatural-language brief → ranked components + recipes + dependency union.
emit_app_contextTheme + selected components + density → the canonical paste-into-LLM markdown blob.
3 endpoints LLMs already understand
Static text, no SDK, no auth, no rate limit. An agent that can fetch can read every component, every recipe, every theme — and your live tweaks too.
- /llms.txt
Short index — package list, tool catalog, and a pointer to the full guide. The Cursor / Claude / Perplexity convention.
bashcurl https://hex-core.dev/llms.txt - /llms-full.txt
Every per-package mini-guide concatenated. One fetch ingests the whole stack into the agent's context.
bashcurl https://hex-core.dev/llms-full.txt - /studio/copy
Your tweaked theme + selected components rendered as the canonical buildAppContext markdown. Same blob the MCP emit_app_context tool emits.
bashopen https://hex-core.dev/studio/copy
Independent release cadences
Token tweaks ship without re-testing the whole component library. Adopt only the packages you need; skip the rest. Each package has its own mini-guide.
@hex-core/componentsv1.12.0runtime164 Radix + CVA components incl. layout primitives + ColorPicker, Tailwind v4 entry.
Read the guide →@hex-core/tokensv1.3.6runtimeHSL design tokens, theme presets, and CSS/Tailwind transformers.
Read the guide →@hex-core/themesv0.2.2runtimePremium theme catalog — midnight, ember, and future presets.
Read the guide →@hex-core/registryv0.5.1runtimeZod schemas + TypeScript types for components, themes, and recipes.
Read the guide →@hex-core/payloadv0.3.0runtimePure-function builders for the canonical LLM context markdown.
Read the guide →@hex-core/cliv0.9.0toolThe hex binary — init, add, list, theme apply, recipe add.
Read the guide →@hex-core/mcpv0.6.0toolStdio MCP server: emit_app_context, emit_figma_tokens, resolve_spec, and more.
Read the guide →@hex-core/previewv0.2.0toolDemoSurface wrapper for showcasing components on flat-white pages.
Read the guide →
Install in one command
Copy any component into your project. No npm dependency.
pnpm dlx @hex-core/cli add button