Responsive, semantic border-radius tokens that scale corners across breakpoints.
Create UI ships a semantic border-radius scale, rounded-component-*. Ten tokens: eight scale with the viewport, two are fixed on purpose. A single class such as rounded-component-5xl resolves to one value on mobile, another on tablet, and another on desktop, so you set the intent once and the corners adapt on their own.
One class, three values. The outlined panel is your screen right now, so resize the window and watch it move.
2 media queries in the system, 0 in your markupWhy it helps
Responsive corners normally mean writing one class per breakpoint and keeping the jumps in sync by hand. The hero above, written without tokens:
With the semantic scale the same behavior collapses into one class:
The win is threefold:
- One class, no per-breakpoint variants. You describe the role of the corner ("this is a large component radius"), not three separate pixel decisions.
- Design-token alignment. The scale mirrors the Figma radius tokens, so corners stay consistent across components instead of drifting toward ad hoc values.
- One-file retuning. Adjusting the scale is a single edit, not a find-and-replace across every component that hard-coded
rounded-md md:rounded-lg.
Usage
Apply a token the same way you would any Tailwind radius utility:
rounded-component-full resolves to 9999px, which produces a pill shape on rectangular elements and a perfect circle on square ones.
Controls hold, surfaces soften
The bare radius scale (rounded-sm, rounded-md, rounded-lg, and so on) is fixed at every breakpoint. Both scales are in use, and the split is deliberate:
- Controls hold a fixed radius.
ButtonandInputuse the bare scale andCheckboxpins exact pixel radii, so a control's corner never resizes underneath the reader mid-scroll. - Surfaces soften on small screens.
ModalandSidebarround their panels withrounded-component-*, andDropdownMenuandStepperuse it on their items, because a 48px corner that reads as generous on a desktop card is overbearing on a phone.
Reach for rounded-component-* when you are drawing a surface, and the bare scale when you are drawing a control.
Every step's desktop value matches the plain Tailwind step of the same name. Moving from rounded-lg to rounded-component-lg changes nothing at 1280px and up, and softens the corner on smaller screens on its own.
Token reference
Every token, with its corner magnified at each breakpoint so the small steps stay legible and the scaling is visible rather than asserted. Three windows mean the radius changes across breakpoints; one window means it is fixed everywhere. Clicking a token name copies its full utility class.
How it compiles to CSS
The CLI emits the desktop value into :root, then layers tablet and mobile overrides as max-width media queries. Take component-lg (6px mobile, 6px tablet, 8px desktop):
Desktop (8px) is the base in :root. The 1279px query drops it to 6px for tablet and below. There is no 767px mobile block here because mobile (6px) already equals tablet.
A breakpoint is omitted whenever its value matches the next-larger one. Mobile is skipped when it equals tablet, and tablet is skipped when it equals desktop, which keeps the generated CSS minimal.
The CLI also writes an @theme inline block registering each variable as a theme token, and that registration is what turns --radius-component-lg into the rounded-component-lg utility. A loose :root variable on its own generates nothing.
Customizing the scale
Override any --radius-component-* variable in your own globals.css, following the same pattern: the desktop value on :root, smaller ranges in the max-width blocks. The @theme inline block regenerates the matching utility, so nothing has to be rebuilt. To take an updated scale instead of keeping a local edit, re-run npx @create-ui/cli init.