Skip to documentation content

Radius

Use Honest UI's radius scale for consistent corners, pills, and circular shapes.

Radius tokens keep corner decisions consistent across components and let a product change its overall character without rewriting component classes. Honest UI provides seven roles, from subtle rounding to a full pill or circle.

The scale applies wherever the theme is loaded. There is no attribute to set: controls are clearly rounded, and cards are large and calm.

Honest UI radius tokens
PreviewTokenValue
--hui-radius-1Small controls and subtle corner treatment6px
--hui-radius-2Buttons, inputs, menus, and badges10px
--hui-radius-3Grouped component containers12px
--hui-radius-4Dialogs, sheets, and larger surfaces16px
--hui-radius-5Cards and large panels20px
--hui-radius-6Extra-large or expressive surfaces28px
--hui-radius-fullPills, circular avatars, and round indicators800px
--hui-radius-frame-panelFramePanel cornersvar(--hui-radius-3)
--hui-radius-frameFrame corners, concentric with the panels insidecalc(panel radius + 8px)

Earlier styles

Honest UI used to offer modern, traditional, and soft values for data-style. They are merged into the one style above. Existing data-style attributes are ignored, so you can remove them when convenient. honestui/theme.css now includes the style, and honestui/soft.css remains as a copy so existing imports keep building.

For denser screens, use a compact density scope instead of a smaller radius scale.

Tailwind usage

<article className="overflow-clip rounded-[var(--hui-radius-3)]">
  <img
    alt=""
    className="rounded-[var(--hui-radius-2)]"
    src="/project-cover.jpg"
  />
  <span className="rounded-[var(--hui-radius-full)]">Active</span>
</article>

To round a product differently, override the radius tokens on :root after the theme. Component classes do not need to change.

Practical guidance

  • Pick a token by the element's role and reuse it. Similar controls should not have slightly different corners.
  • Keep nested radii visually related. An inner element normally uses the same or a smaller token than its container.
  • Use --hui-radius-full for pills and circles rather than choosing an arbitrarily large number.
  • Radius does not make an element interactive. Preserve visible boundaries, affordances, labels, and focus indicators.
  • Test clipped focus rings and content near rounded corners. Use the focus-ring offset tokens documented in Effects when a container would otherwise cut the indicator off.