Article treatment
I Built an AI-Friendly UI Pattern Library
A UI pattern library where every pattern ships the prompt that rebuilds it, so a coding agent can put it in your codebase instead of you copying CSS.
- AI
- Claude Code
- CSS
- UI
Just here for the library? It's at antjanus.com/patterns. Every pattern ships with its HTML, CSS, and JavaScript, plus a prompt written for a coding agent to read.
I’ve always been a fan of sites like Dribbble, or back in the day Forrst (later Tavern). Places where designers (and sometimes devs) could share interesting new ways to interact with an application.
Maybe it’s just me but the golden age of that era disappeared as soon as AI showed up. Suddenly, code didn’t matter. Suddenly, the best-ever experience for the user stopped mattering. What matters now is throughput and building out new features.
UI Slop
The word “slop” is just so fitting here. Coding agents tend to over-rely on a handful of UI patterns and try to fit everything into them. Due to this issue, AI-generated apps and websites all have a distinct “feel” to them. That includes my own site. Sure, I directed the AI how to build out certain sections and features. And sure, I worked with it to get a customized look.
But everyone can tell. Here’s what I usually see:
- the UI pattern of using thin wide cards – think notifications. And then highlighting the left side of the card with a thick border
- rounded borders everywhere
- gradients EVERYWHERE
- that purple. (Check my “AI” button in the navbar, THAT purple)
- that one blue that shows up whenever someone just doesn’t like purple.
- entirely too serif-y typography
I don’t have to go looking for an example. Here’s the top of my own AI section:

I rebuilt my website this year and these patterns show up everywhere. Let’s break this one down a bit:
- we have the stylish heading Serif typography
- we have the standard “purple”
- we have the gradient that mixes that AI purple with the AI blue
- the cards have rounded corners and, again, using the AI “purple”
The dots in the background were actually an addition from me.
There are tons more of these and it sucks because it’d be so wonderful to just point Claude at a website or app and say “Make it look good”. But is that even possible?
Typical solutions, typical pitfalls
What you’ll run into with coding agents is that they’ll generally follow directions. For example:
Build a dashboard of my currently watched TV shows from my movie library
It’ll build it, but it’ll look generic and lose out on usability quite a bit. When I did this, Claude created a horizontally-scrolling list that is hard to understand and hard to use. It surfaced a ton of metrics I didn’t care that much about (watch time, potential watch time, time to finish, number of movies and TV shows, etc.) but nothing I actually needed.
How?
Each UI pattern contains the HTML, CSS, and JavaScript to make it work. On top of that, each one contains a “Prompt” section to help coding agents understand the particular UI element — including how it’s supposed to be used, a description of how it looks and works, when not to reach for it, and even how to colorize it.
Here’s one of them running live, the windowed schedule grid. It’s rows of resources against a fixed time window, where each block is sized by how much it overlaps the window instead of by its own duration. Step the window forward and watch the blocks get clipped at the boundary:
Open the windowed schedule grid running live in the pattern library →
This is the pattern I wish Claude had reached for instead of that horizontally-scrolling list. It’s a TV guide, a room booking board, an on-call rotation — same layout every time.
The interesting part isn’t the CSS, though. It’s the prompt that ships with it, which reads less like documentation and more like the notes I’d give a developer:
Reach for this whenever a schedule has to render arbitrary-duration entries inside a fixed viewport […] It is wrong for a full-day timeline that scrolls freely (there a duration-proportional layout with absolute positioning is simpler and correct), and wrong when entries never span more than a few minutes (then a plain list beats a grid).
Keep time as minutes-since-midnight integers everywhere in the layout — never construct a
Dateinside the render path.Below roughly 6% of window width a block has no room for its label — drop the text entirely and render a bare accent-colored sliver instead of letting text overflow or wrap. Keep the full label reachable anyway by putting it in the native
titleattribute.
Copy-paste CSS gives the AI a starting point and reference. A prompt gives it the reasoning — including the cases where it should walk away and build something simpler.






















