Border radius generator

Set each corner on its own, read the shorthand as it collapses, and copy it as CSS, a Tailwind arbitrary value or a theme token.

A photograph shaped by the current corner radii
radius.csscss
.card {
  border-radius: 24px 4px;
}
usage.tsxtsx
<div class="rounded-[24px_4px]" />
theme.csscss
@theme {
  --radius-card: 24px 4px;
}

Questions

How does the shorthand collapse?+

One number when all four corners agree, two when the diagonals do, four otherwise, read clockwise from the top left. The output writes the shortest form that means what you set.

What makes a radius look right?+

Nesting. An inner radius should be the outer one minus the padding between them, or the two curves will not be concentric and the inner box will look squashed into the corner.

Should this be a token?+

If more than one component uses it, yes. A --radius-* entry in @theme gives you a named utility and one place to change the house shape.

Related tools

The tools are free. So is most of the library.

1935 blocks and 989 pieces for shadcn/ui and Tailwind, built on the same tokens these tools write. Install one with a command and the code is yours.

No signup for the tools. MIT for free blocks, commercial licence for Pro.

Markdown version