Guides

Radius

Choosing the right radius setting in your theme.

Theme setting

Theme radius setting manages the radius factor applied to the components:

<Theme radius="medium">
<TextField.Root size="3" placeholder="Reply…">
<TextField.Slot side="right" px="1">
<Button size="2">Send</Button>
</TextField.Slot>
</TextField.Root>
</Theme>
none
small
medium
large
full

The resulting border-radius is contextual and differs depending on the component. For example, when set to full, a Button becomes pill-shaped, while a Checkbox will never become fully rounded to prevent any confusion between it and a Radio.

<Theme radius="full">
<Flex align="center" gap="3">
<Button>Save</Button>
<Switch defaultChecked />
<Checkbox defaultChecked />
</Flex>
</Theme>

Radius overrides

Certain components allow you to override the radius factor using their own radius prop.

<Flex align="center" gap="3">
<Button radius="none">Save</Button>
<Button radius="small">Save</Button>
<Button radius="medium">Save</Button>
<Button radius="large">Save</Button>
<Button radius="full">Save</Button>
</Flex>

Components that render panels, like Card, Dialog, and Popover, among others, won’t have the radius prop, but will inherit the radius setting from the theme. The radius prop is also unavailable on most text-based components.

Radius scale

Radius values used in the components are derived from a 6-step scale.

1
2
3
4
5
6

While you can’t use a specific step on a particular component directly—the radius prop is used to set just the radius factor—you can use the radius scale to style your own components.

Radius tokens are accessed using CSS variables. You can use these tokens to style your custom components, ensuring they are consistent with the rest of your theme.

/* Radius values that automatically respond to the radius factor */
var(--radius-1);
var(--radius-2);
var(--radius-3);
var(--radius-4);
var(--radius-5);
var(--radius-6);
/* A multiplier that controls the theme radius */
var(--radius-factor);
/*
* A variable used to calculate a fully rounded radius.
* Usually used within a CSS `max()` function.
*/
var(--radius-full);
/*
* A variable used to calculate radius of a thumb element.
* Usually used within a CSS `max()` function.
*/
var(--radius-thumb);
PreviousBreakpoints