# Radius

Shape roles across controls, surfaces, and overlays.

Zenos uses a restrained radius scale to communicate size, containment, and interaction. Smaller shapes belong to compact controls and nested elements; larger shapes define cards, panels, and application frames.

## Scale

<div className="zenos-radius-scale not-content">
  <div className="zenos-radius-token">
    <span style={{ borderRadius: "var(--radius-sm)" }}></span>
    <strong>Small</strong>
    <code>--radius-sm</code>
    <small>4px</small>
  </div>
  <div className="zenos-radius-token">
    <span style={{ borderRadius: "var(--radius-md)" }}></span>
    <strong>Medium</strong>
    <code>--radius-md</code>
    <small>6px</small>
  </div>
  <div className="zenos-radius-token">
    <span style={{ borderRadius: "var(--radius-lg)" }}></span>
    <strong>Large</strong>
    <code>--radius-lg</code>
    <small>8px</small>
  </div>
  <div className="zenos-radius-token">
    <span style={{ borderRadius: "var(--radius-xl)" }}></span>
    <strong>Extra large</strong>
    <code>--radius-xl</code>
    <small>12px</small>
  </div>
</div>

| Token         | Tailwind utility | Typical role                                                        |
| ------------- | ---------------- | ------------------------------------------------------------------- |
| `--radius-sm` | `rounded-sm`     | Menu items, close controls, indicators, and compact nested elements |
| `--radius-md` | `rounded-md`     | Buttons, inputs, tags, popovers, and standard controls              |
| `--radius-lg` | `rounded-lg`     | Accordions, previews, grouped controls, and medium surfaces         |
| `--radius-xl` | `rounded-xl`     | Cards, dialogs, side navigation, and application frames             |

## Match radius to hierarchy

Radius should reinforce the relationship between a container and its children. An outer surface generally uses the same or a larger radius than the controls nested inside it.

```text
Application frame  → extra large
Card or panel      → large or extra large
Input or button    → medium
Menu item or icon  → small
```

Avoid mixing several radii within one compact component. A clear outer shape and one consistent nested shape are usually enough.

## Controls

Interactive controls use medium radius by default. It provides a visible shape without making dense interfaces feel soft or decorative. Small radius is useful for controls nested inside another rounded surface, such as menu items, tags, or close actions.

The radius does not determine the target size. A control can remain visually compact while preserving an adequate pointer and touch area.

## Surfaces and overlays

Cards and persistent panels generally use large or extra-large radius. Temporary overlays use a radius that matches their scale: a compact tooltip may use small radius, while a dialog can use extra large.

Sheets that meet a viewport edge may leave that edge square. Radius should describe the exposed boundary rather than force rounding where the surface continues beyond the viewport.

## Circular and pill shapes

Use a fully rounded shape when geometry carries meaning:

- circular avatars and status indicators
- icon-only controls designed as circles
- pills whose width changes with short, single-line content

Do not make every badge, input, or button pill-shaped. Full rounding creates a stronger visual voice than the core radius scale and should remain intentional.

## Focus and clipping

Focus indicators must follow the component shape and remain visible against nearby surfaces. Avoid clipping an outer focus ring with an overflow-hidden parent.

When a container must clip content, place the focusable element inside the clipping boundary or use an inset focus treatment with sufficient contrast.

## Customization

Override semantic radius tokens when adapting the complete Zenos theme:

```css
:root {
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
}
```

Use `className` for an isolated product-specific shape. Repeated overrides usually indicate that the theme tokens should change instead.

Keep the scale ordered, subtle, and visually distinct. Radius supports hierarchy; it should not become the primary decoration.

Source: https://zenos-ui.pages.dev/foundations/radius/