Radix Themes releases and their changelogs.
Checkbox componentareas prop to the Grid component and gridArea prop to all layout components (Box, Container, Flex, Grid, Section)overflow-wrap: anywhere style to the DataList component so that long values—such as IDs—can break over to next lineCheckbox componentalign, height, minHeight, and maxHeight props to AlertDialog.Content and Dialog.Contentmax prop on the Progress componentgrayColor setting would have no effect in combination with explicit appearance="light" or appearance="dark" valuesLink would use an automatic high-contrast color when an explicit color value was used.Link would not use the correct text selection and focus color when nested in gray text.Link tap highlight styleCheckboxGroup.Item and RadioGroup.Item so that a layout with overflowing text truncation would be possible to achievedata-accent-color attribute from components where it had no practical effect to be there.color prop definition.TextField and TextArea--spinner-animation-duration CSS variable for the Spinner componentLink would not use an automatic high-contrast color when nested within colored text.Link wouldn't display hover styles when rendered as a buttonTextArea would not preserve sequences of white space in Firefoxsize="1" indicator checkmark alignment in SafariRadix Themes 3.0 comes with a new layout engine, 11 new components, and full ESM support. Read the announcement.
This release introduces a number of breaking changes. Please follow the steps below to upgrade.
DialogRoot → Dialog.RootDialogTrigger → Dialog.TriggerDialogContent → Dialog.ContentAlertDialogCalloutContextMenuDialogDropdownMenuHoverCardPopoverRadioGroupSelectTableTabsTextField@radix-ui/themes import entry point.
@radix-ui/themes/props and @radix-ui/themes/helpers instead.width and height props on layout components don't map to space scale anymore. Find and replace your width and height prop usage with the corresponding space scale steps:
width="1" → width="4px"width="2" → width="8px"width="3" → width="12px"width="4" → width="16px"width="5" → width="24px"width="6" → width="32px"width="7" → width="40px"width="8" → width="48px"width="9" → width="64px"heightvar(--space-1) to var(--space-9) instead of hardcoded values.shrink and grow props on layout components were renamed
shrink → flexShrinkgrow → flexGrowIf you were using the following tokens for your custom components, make sure to replace the corresponding references.
--color-surface-accent → --accent-surface--accent-9-contrast → --accent-contrast--red-9-contrast → --red-contrast--pink-9-contrast → --pink-contrast--blue-9-contrast → --blue-contrast--color-autofill-root → --focus-a3--color-focus-root → --focus-8--color-selection-root → --focus-a5--gray-2-translucent and the corresponding tinted gray colors were removed.
--color-panel-translucent in combination with a backdrop blur filter instead.AlertDialog, Dialog now have maxWidth="600px" by default on the Content part.
580px value. If you use dialogs that need a different width, override maxWidth with your own value.Badge has a new size="3", size="2" is now much smaller, and size="1" dimensions were tweaked
size="2" usage with size="3"Card internal HTML structure and styles were reworked and now renders a single HTML node. Make sure that your code works as expected if you were relying on any of the implementation quirks to override styles or behaviour.
ghost, use --card-background-color variable instead of assigning background-color directly, or set your background color on an <Inset p="current"> element nested as the first child of the Card.asChild or is asChild’ed onto by a parent component. (The common case with link or button card without any extra styles will work as expected).HoverCard and Popover now have maxWidth="480px" by default on the Content part.
maxWidth with your own value.RadioGroup internal HTML structure and styles were reworked and is now designed to display an optional text label when passing children to the Item part. The Root part now also provides flex column styles and spacing.
Radio component insteadSection has a new size="3"
size="3" to size="4"Tabs underlying letter/word spacing CSS variables were renamed to support both Tabs and TabNav components. If you were using them, rename them to the new values:
--tabs-trigger-active-letter-spacing → --tab-active-letter-spacing--tabs-trigger-active-word-spacing → --tab-active-word-spacing--tabs-trigger-inactive-letter-spacing → --tab-inactive-letter-spacing--tabs-trigger-inactive-word-spacing → --tab-inactive-word-spacingTextField now only has 2 parts: Root and Slot, dropping the Input part and simplifying how props are forwarded.
TextField.Input parts used without TextField.Root should be renamed to TextField.RootTextField.Input parts used within TextField.Root should be removed and their props should be put directly on the TextField.Root partTextField.Slot parts placed to the right of TextField.Input will need side="right" prop. However, no adjustment is needed when two slots were used within one TextField, e.g. one slot on the left and another one on the right. In that case, the slots will be automatically placed on different sides.Theme does not set body background color automatically anymore. The background color is now provided by the root Theme by default. The CSS variable --color-page-background is no longer available.
--color-background available on the .radix-themes element.Tooltip now has maxWidth="360px" by default on the Content part.
maxWidth with your own value.@radix-ui/themes import entry point and export them from @radix-ui/themes/props and @radix-ui/themes/helpers to make it possible to build your own component library on top of Radix Themes using the same techniques.tokens.css, components.css, and utilities.css files in case you need fine-grained control of the CSS precedence. For example, this allows to import Radix Themes utilities.css after your own CSS, and everything else before that.tokens.css, you can also import tokens/base.css and tokens/colors/*.css, where * corresponds to the names of the accent and gray colors you need in your project.layout.css that only includes styles for the layout components (Box, Flex, Grid, Container, Section). Individual exports layout/tokens.css, layout/components.css, and layout/utilities.css are also available to support the above use-case.minWidth, maxWidthminHeight, maxHeightflexBasis, flexShrink, flexGrowgridColumn, gridColumnStart, gridColumnEndgridRow, gridRowStart, gridRowEndoverflow, overflowX, overflowYwidth, minWidth, maxWidthheight, minHeight, maxHeightm, mx, my, mt, mr, mb, mlp, px, py, pt, pr, pb, plinset, top, right, bottom, leftgap, gapX, gapYflexBasis, flexShrink, flexGrowgridColumn, gridColumnStart, gridColumnEndgridRow, gridRowStart, gridRowEndwidth and height props don't map to space scale anymore. This is because in the vast majority of cases, width and height were not set to space scale, and with that, space scale as an IDE autocomplete suggestion felt odd/misleading.shrink and grow props to flexShrink and flexGrow"auto" or "100vw" are still available as manual string values.initial key would not apply the default prop valuecolor, defaultValue, and defaultChecked attributes from components that inherit them from the native HTML elements to avoid confusion with their custom implementationsasChild prop on all components and partshighContrast text colors work consistently when nested within other components that accept an accent colorvariant="soft" menu items--color-surface-accent to --accent-surface--accent-9-contrast, --red-9-contrast, --pink-9-contrast, --blue-9-contrast, etc. to --accent-contrast, --red-contrast, --pink-contrast, --blue-contrast and so on.--gray-2-translucent and the corresponding tinted gray colors--color-surface and --color-panel-translucent values--color-focus-root, --color-selection-root, --color-autofill-root with a focus color scale, e.g. --focus-1 – --focus-12, and --focus-a1 – --focus-a12.box-sizing: border-boxDataList
RootItemLabelValueCheckboxGroup
RootItemCheckboxCards
RootItemProgress
Radio
RadioCards
RootItemReset
SegmentedControl
Skeleton
loading prop.Spinner
Skeleton, it also may wrap any UI element and display itself using a conditional loading prop.TabNav
Tabs, but used for page navigation. Renders regular links and supports roving focus. Parts:
RootLinkAlertDialog, Dialog
position: relative to support absolutely positioned children.width, minWidth, maxWidth props to the Content part.maxWidth="600px" by default on the Content part.Badge
user-select: nonesize="3", make size="2" much smaller, tweak size="1" dimensionsBlockquote, Code, Em, Heading, Quote, Link, Strong, Text
wrap and truncate props that control whether the text wraps and whether it is truncated with ellipsisCard
Code
variant="ghost" color now works similarly to Text, inheriting the color unless set explicitly using the color propContainer
align prop to control whether the container content is aligned to the left, center, or rightdisplay="block" value to display="initial" (the former value was broken)ContextMenu, DropdownMenu
color prop to CheckboxItem and RadioItem partsCheckbox, RadioGroup, Switch
DropdownMenu
variant="soft"TriggerIcon part that renders an arrow down indicatorBox, Flex, Grid
as prop to render as span or divdisplay: block style is now enforced regardless of the tagButton, IconButton
loading propFlex
gapX and gapY propsHoverCard, Popover
position: relative to support absolutely positioned children.width, minWidth, maxWidth, height, minHeight, maxHeight props to the Content part.maxWidth="480px" by default on the Content part.RadioGroup
children to the Item part, and the Root part now provides flex column styles and spacing.Section
display="block" value to display="initial" (the former value was broken)size="3", use the previous value for size="4"Select
<label> elementSeparator
orientation propScrollArea
Slider
flex-shrink: 0 with flex-grow: 1 and width: stretch / height: stretch to allow the slider element to flex and shrink in layouts more intuitively.Table
layout prop to control the table-layout style propertywidth prop type signature and implementation on the TableCell part with the reworked width prop on the layout componentsminWidth and maxWidth props to the TableCell partTabs:
color and highContrast props to TabsListTabsList and TabsContent.radix-themes so that it supports both Tabs and TabNav components.
--tabs-trigger-active-letter-spacing → --tab-active-letter-spacing--tabs-trigger-active-word-spacing → --tab-active-word-spacing--tabs-trigger-inactive-letter-spacing → --tab-inactive-letter-spacing--tabs-trigger-inactive-word-spacing → --tab-inactive-word-spacingTextArea
radius propresize prop<label> elementTextField
Input part to simplify how props are forwarded and rework internal HTML structure and styles.types not supporting getSelectionRange<label> elementThemePanel
Theme
min-height: 100vh on the root Theme componenthasBackground prop value would have no effectTheme has a background color by default. Theme without an explicit hasBackground prop will display a background color:
Theme component<Theme apperance="light"> or <Theme apperance="dark">Theme by default.
--color-page-background is no longer available.suppressHydrationWarning on html is no longer needed (unless required by other libraries, like next-themes)Tooltip
width, minWidth, maxWidth props.maxWidth="360px" by default on the tooltip contentCard
variant="surface" border color may disappear in browsers that don't support color-mix.variant="surface" border color.Code
variant="ghost" is used within a Link, make sure that underline="hover" on the Link is respected.TextField
0,1,0 for styling HTML elements and at 0,1,1 for styling pseudo-elements, improving compatibility with Tailwind.
--black-a1, --white-a1, etc.), make sure to check the new values and update the steps used so that your designs look as expected:
--black-a1 to rgba(0, 0, 0, 0.01).--black-a2 to rgba(0, 0, 0, 0.024).--black-a3 to --black-a1.--black-a4 to --black-a2.--black-a5 to --black-a2.--black-a6 to --black-a3.--black-a7 to --black-a3 or --black-a4.--black-a8 to --black-a5.--black-a9 to --black-a6 or --black-a7.--black-a10 to --black-a7.--black-a11 to --black-a8.--black-a12 to --black-a11.--white-a1 to transparent.--white-a2 to rgba(255, 255, 255, 0.01).--white-a3 to --white-a1 or --white-a2.--white-a4 to --white-a2.--white-a5 to --white-a3.--white-a6 to --white-a3 or --white-a4.--white-a7 to --white-a4.--white-a8 to --white-a5.--white-a9 to --white-a6.--white-a10 to --white-a7.--white-a11 to --white-a9.--white-a12 to --white-a11 or --white-a12.color="gray" component, similarly to the text selection color.Theme component also sets the corresponding browser colors, like the correct input autofill background color.@keyframes animations with rt- prefix and into kebab case.outline rather than box-shadow for most focus styles, which avoids a slight anti-aliasing issue in Chrome on focused elements.AlertDialog, Dialog
Avatar
svg assets as a fallback, make sure to set an appropriate size manually.--cursor-button: default;--cursor-checkbox: default;--cursor-disabled: not-allowed;--cursor-link: pointer;--cursor-menu-item: default;--cursor-radio: default;--cursor-slider-thumb: default;--cursor-slider-thumb-active: default;--cursor-switch: default;.rt-reset-button and .rt-reset-a classes with a single .rt-reset class.
.rt-reset class can be use to reset a, button, h1, h2, h3, h4, h5, h6, ol, ul, p, and pre tags when building custom components.Blockquote
trim prop.Button, IconButton
disabled together with asChildvariant="classic" look and feel across different accent colors in light and dark mode.Callout
Callout.Text elements within Callout.Root
Callout.Root happened to provide flex properties, change your layout to use a Flex component explicitly.color prop was passed.
highContrast prop to your callouts to make the text darker.variant="surface".variant="outline".Checkbox
Text component automatically aligns the checkbox with the first line of the text.
<Text as="label" size="...">, using your preferred text size.size="1", change the default size to size="2", add a more refined size="3"
size="1" or size="2" checkboxes via an explicit size prop, rename them to size="2" and size="3" respectively.variant="classic".Card
variant="classic" shadow so that it doesn’t extend outside of the element.variant="classic".Code
Code is within Link.variant="ghost" font size would be inconsistent depending on whether the size was based on a parent Text element or came from the code’s own size prop.variant="outline" and variant="surface".::selection background color for variant="solid"..radix-themes for customising the padding of Code variants in case the default values don’t work well with the vertical metrics of custom code font.
--code-padding-top--code-padding-bottomDropdownMenu, ContextMenu
radius="full".Grid
Grid components could cause the descendant Grid’s to inherit some parent styles unintentionally.Inset
clip prop to control whether content is clipped to the padding or to the border of the parent element.Table is inside InsetKbd
Link
Heading elements (similarly to the automatic high-contrast within Text).variant="outline" and variant="surface".RadioGroup
Text component automatically aligns the radiobutton with the first line of the text.
<Text as="label" size="...">, using your preferred text size.size="1", change the default size to size="2", add a more refined size="3".
size="1" or size="2" radio buttons via an explicit size prop, rename them to size="2" and size="3" respectively.variant="classic".Select
variant="classic" look and feel across light and dark mode.SelectContent to the left of the trigger when using position="popper".size="3".ScrollArea
.radix-themes to facilitate easier scrollbar position adjustments.
--scrollarea-scrollbar-margin-top, --scrollarea-scrollbar-margin-left, etc. make sure that they follow the new names and are set at the appropriate level. There's no need to target .rt-ScrollAreaScrollbar element to set the variables anymore, as they can be set just on the component that needs the override. New variables:
--scrollarea-scrollbar-horizontal-margin-top--scrollarea-scrollbar-horizontal-margin-bottom--scrollarea-scrollbar-horizontal-margin-left--scrollarea-scrollbar-horizontal-margin-right--scrollarea-scrollbar-vertical-margin-top--scrollarea-scrollbar-vertical-margin-bottom--scrollarea-scrollbar-vertical-margin-left--scrollarea-scrollbar-vertical-margin-rightSlider
Switch
Switch component automatically aligns the switch with the first line of the text.
<Text as="label" size="...">, using your preferred text size.size="2" and size="3" smaller.
size="3" instead of size="2" to match the previous look.Table
Tabs
.radix-themes for customising the letter spacing and word spacing of active and inactive tabs so that you can minimise the apparent shift in weight in case the default values don’t work for your custom font.
--tabs-trigger-active-letter-spacing--tabs-trigger-active-word-spacing--tabs-trigger-inactive-letter-spacing--tabs-trigger-inactive-word-spacingText
as="label" option to the as prop.as prop isn’t specified.TextArea
TextArea behaves like a true display: block element, filling the available space horizontally.style and className are now forwarded to the wrapping div element. The ref and other props are still forwarded to the textarea itself.TextArea styles via style, className, or custom CSS that targets the related HTML nodes, make sure that your custom styles work as expected.TextArea set by the browser, make sure that your layout looks as expected.TextArea overflows.TextField
z-index of the container to avoid potential stacking issues.text-indent instead of padding-left so that long values aren't truncated on the left when the cursor is at the end of the input.ThemePanel
Tooltip
radius="full".multiline prop.
multiline prop, pass style={{ maxWidth: 250 }} to the relevant Tooltip elements.ThemeProps and ThemePanelPropsruby, iris, and jadeReact.FC type for ContextMenuSub, DialogRoot, HoverCardRoot, and PopoverRoot, resolving a type error with certain setups.