# Radius

The preset corner radius scale, for whole elements or single corners.

- ID: tokens/radius
- Type: tokens
- Canonical: /reference/tokens/radius
- Version: 2.1.8
- Source revision: 09fc2350ea80ed137ba7ca62c8e5926744b5a5dc (revision)
- Source: packages/preset/src/theme.css
- Content digest: 5977bc8371fb12adecd424ac9f66760d34af46de8f2b96edb4a5f357cce296db
- Semantic digest: 83962260d6d56817dd052d2beebf7999a75804215dac050c47b26353145c099a
- Language: en

<a id="consumers"></a>

## Classes

| Class | Property | Declarations |
| --- | --- | --- |
| [`r-<name>`](/reference/tokens/families#family-r) | `border-radius` | `border-radius: var(--radius-<name>)` |
| [`rbl-<name>`](/reference/tokens/families#family-rbl) | `border-bottom-left-radius` | `border-bottom-left-radius: var(--radius-<name>)` |
| [`rbr-<name>`](/reference/tokens/families#family-rbr) | `border-bottom-right-radius` | `border-bottom-right-radius: var(--radius-<name>)` |
| [`ree-<name>`](/reference/tokens/families#family-ree) | `border-end-end-radius` | `border-end-end-radius: var(--radius-<name>)` |
| [`res-<name>`](/reference/tokens/families#family-res) | `border-end-start-radius` | `border-end-start-radius: var(--radius-<name>)` |
| [`rse-<name>`](/reference/tokens/families#family-rse) | `border-start-end-radius` | `border-start-end-radius: var(--radius-<name>)` |
| [`rss-<name>`](/reference/tokens/families#family-rss) | `border-start-start-radius` | `border-start-start-radius: var(--radius-<name>)` |
| [`rtl-<name>`](/reference/tokens/families#family-rtl) | `border-top-left-radius` | `border-top-left-radius: var(--radius-<name>)` |
| [`rtr-<name>`](/reference/tokens/families#family-rtr) | `border-top-right-radius` | `border-top-right-radius: var(--radius-<name>)` |

Fully rounded corners use the fixed `pill` utility, not a radius token: it sets only `border-radius: calc(infinity * 1px)`.

<a id="values"></a>

## Values

The eight preset radii are rem lengths. Pixel equivalents assume a 16px root font size. A radius shapes corners; it does not set the box dimensions.

| Class | Variable | Value |
| --- | --- | --- |
| `r-xs` | `--radius-xs` | `.125rem` |
| `r-sm` | `--radius-sm` | `.25rem` |
| `r-md` | `--radius-md` | `.375rem` |
| `r-lg` | `--radius-lg` | `.5rem` |
| `r-xl` | `--radius-xl` | `.75rem` |
| `r-2xl` | `--radius-2xl` | `1rem` |
| `r-3xl` | `--radius-3xl` | `1.5rem` |
| `r-4xl` | `--radius-4xl` | `2rem` |

<a id="rounding-and-clipping"></a>

## Rounding and clipping are separate

`r-4xl` rounds the parent’s background and border. It does not give a child the same radius or automatically clip that child’s painting. Add `overflow-hidden` when the parent should clip its contents to the rounded edge.

**The parent’s radius does not round its child**

Both parents use r-4xl and the same content. Only the right parent adds overflow-hidden. Blue identifies the child surface; the dashed contour marks the parent’s rounded edge.

- Both parent boxes use r-4xl, whose preset value is 2rem. They contain identical child and parent-content regions, with dimensions following the same content.
- The left parent keeps the default visible overflow. Its own background is rounded, but the blue child paints a rectangle at the top.
- The right parent adds overflow-hidden. The same child rectangle is clipped to the parent’s rounded edge; the child does not inherit a radius.
- The dashed contour is an inspection annotation, not a border emitted by r-4xl. The color only identifies the same child in both examples.

The physical families such as `rtl-` always address the top-left corner. Logical families such as `rss-` follow the block-start and inline-start sides, so their physical corner depends on writing mode and direction. Every mapping is listed above.

Oversized radii are reduced by the browser when adjacent curves would overlap. This is why `pill` produces a capsule on a wide box and a circle on a square. It does not make an element square.

For a square corner use the direct-value function `r(0)` or its single-corner counterpart, such as `rtl(0)`. The preset has no `--radius-none` token. Negative token forms such as `-r-md` are rejected.

See [native corner clipping](https://www.w3.org/TR/css-backgrounds-3/#corner-clipping) and [direct values](/reference/direct-values).

<a id="usage"></a>

## Usage

Step the radius down from a sheet to the thumbnail inside it.

```html
<div class="… r-lg">
  <div class="… r-md">FN</div>
  <div>
    <p>Field notes</p>
    <p>Every Friday</p>
  </div>
  <span class="… pill">Weekly</span>
</div>
```

```css disclosure=generated-css
@layer theme{:root,:host{--radius-md:.375rem;--radius-lg:.5rem}}@layer utilities{.r-lg{border-radius:var(--radius-lg)}.r-md{border-radius:var(--radius-md)}.pill{border-radius:calc(infinity * 1px)}}
```

<a id="customize"></a>

## Customize

Change a preset value or add a token: `--radius-card` creates `r-card` and each single-corner class.

```css
@theme {
  --radius-md: .5rem;
  --radius-card: 1.25rem;
}
```

```css disclosure=generated-css
@layer theme{:root,:host{--radius-card:1.25rem}}@layer utilities{.r-card{border-radius:var(--radius-card)}}
```

See [theme directives](/reference/directives/theme) and [Color](/guide/colors#raised-surfaces).

## Related reference

- [rules/modes](/reference/rules/modes.md)
- [directives/theme](/reference/directives/theme.md)
