DEV Community

Cover image for Your coding agent keeps writing the same UI. Give it real components instead
Behavio
Behavio

Posted on Fully Autonomous

Your coding agent keeps writing the same UI. Give it real components instead

Ask a coding agent for a pricing section and you get the same pricing section everyone else gets: three cards, the middle one highlighted, a gradient somewhere. Agents write UI from memory, and their memory averages out to a template.

Good UI code is already out there, free to use. shadcn/ui, Radix, Base UI, Magic UI, Kokonut UI, Aceternity UI and the shadcn-style registries around them have components that someone designed, tested and shipped. The agent just doesn't know where to look, and searching 40 sites by hand is not something you want to do for every screen.

We built Clay UI for that gap. It is an MIT-licensed CLI plus an agent skill. Your agent asks it for a component, picks from real matches, downloads the source and then rewrites it to fit your project.

What it looks like

Install it in a project:

npx @behavio1/clayui init
Enter fullscreen mode Exit fullscreen mode

How Clay UI works: you ask, your agent reads the need, Clay UI searches a local index, you pick a variant, Clay UI downloads the source, and your agent shapes it into your project

This installs a skill for Claude Code (and for Codex, Cursor and other agents that read .agents/skills) and builds a local index of the libraries. After that you talk to your agent as usual:

Find me a data table with filters and make it match our dashboard.

The agent runs a search. Here is real output from version 0.5.0, with no API keys set:

$ clayui search "data table with filters" --limit 4
beautifului/filter-table  [gaps: preview-unverified]
    Filter Table — Status chips that reorganize live data.
    preview: https://www.beautifului.dev/#filter-table
reui/data-grid-column-filter  [complete]
    Data Grid Column Filter
    preview: https://reui.io/docs/data-grid-column-filter
blocks-so/table-03  [gaps: no-preview]
    Table with Filters — A table with filters block.
    preview: none
uiarc/filter-toolbar  [complete]
    Filter toolbar — Keep collection filters close and easy to reset.
    preview: https://uiarc.dev/components/filter-toolbar
Enter fullscreen mode Exit fullscreen mode

You open the preview links, pick one, and the agent runs clayui get <id>. The source lands in a local folder as an example. The agent then rewrites it for your stack, tokens and style. Clay UI never installs a component or a dependency into your project. What ends up in your codebase is code your agent wrote, starting from something that already worked.

Before and after

We rebuilt five screens of a made-up app this way. The left side is a typical template; the right side uses components Clay UI found: aceternity/hero-highlight, avara/pricing-section, spectrum/insight-cards, devl/split-sign-up and magicui/bento-grid.

Five screens before and after

There is a 53-second film of the same comparison on the website.

A few decisions we made

Licenses first. A library only goes into the index if its license allows passing the source on and its code can be fetched by a machine. React Bits, Animate UI, shadcnblocks and shadcn studio are out because their licenses forbid redistribution. Prism UI is out because it is AGPL. The README lists every library we reviewed and left out, with the reason. Downloaded components keep their authors' terms, so keep their notices when you adapt them.

Local and keyless by default. The index lives on your machine, and search works right after install using keywords. If you add a Gemini API key, it switches to semantic search; only then does your query go to Gemini to be embedded. No account is needed.

A small native binary. The CLI is written in Rust. npx fetches the right binary for macOS, Linux or Windows, so you need Node 18.20.8+ and nothing else.

The agent stays in charge. Clay UI only finds and downloads. Matching your design system, tokens and naming stays the agent's job, with you reviewing the result.

Try it

npx @behavio1/clayui init
Enter fullscreen mode Exit fullscreen mode

If a library you like is missing, open an issue with a link to it and how its components can be fetched. We would also like to hear where search gives you bad matches. How we measure search quality is written up in docs/search-tuning.md.

Disclosure: we are the team that builds Clay UI. This article was written with help from Claude. The search output above is from a real run of Clay UI 0.5.0.

Top comments (0)