Getting Started

Raw
Implementationlatest2026Retrieved 2026-05-12

Getting Started

Source: radix-ui.com/themes/docs/overview/getting-started


Installation

npm install @radix-ui/themes

Setup

1. Import the CSS file at the root of your application:

import "@radix-ui/themes/styles.css";

2. Wrap your app in the <Theme> component inside <body>:

import { Theme } from "@radix-ui/themes";

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        <Theme>
          {children}
        </Theme>
      </body>
    </html>
  );
}

3. Use components:

import { Flex, Text, Button } from "@radix-ui/themes";

export default function MyApp() {
  return (
    <Flex direction="column" gap="2">
      <Text>Hello from Radix Themes</Text>
      <Button>Let's go</Button>
    </Flex>
  );
}

Theme configuration

Pass configuration props to <Theme> to customize the visual appearance:

<Theme accentColor="crimson" grayColor="sand" radius="large" scaling="95%">
  <MyApp />
</Theme>
PropDefaultOptions
accentColorindigo27 color names
grayColorauto-pairedgray, mauve, slate, sage, olive, sand
radiusmediumnone, small, medium, large, full
panelBackgroundtranslucentsolid, translucent
scaling100%90%, 95%, 100%, 105%, 110%
appearanceinheritlight, dark, inherit

ThemePanel (development)

Add ThemePanel inside your <Theme> to get a live configuration UI during development:

import { Theme, ThemePanel } from "@radix-ui/themes";

<Theme>
  <MyApp />
  <ThemePanel />
</Theme>

Remove ThemePanel before shipping to production.


Next.js CSS import order

When using the App Router, CSS import order may conflict with other stylesheets. Radix Themes must be imported before any overrides. If you encounter issues, configure your bundler to preserve CSS order, or use the next.config transpilePackages option.

For custom fonts via next/font, see the Typography guide.


Radix Themes vs Radix Primitives

Radix PrimitivesRadix Themes
StylingUnstyled (headless)Pre-styled with theme system
Use caseFull design control, custom systemsOut-of-the-box UI
Token systemNoneCSS variables on .radix-themes
Package@radix-ui/react-* (per-component)@radix-ui/themes

Radix Themes is built on Radix Primitives. Both share the same accessibility foundations (ARIA patterns, keyboard navigation). You can use Primitives directly alongside Themes if you need components not yet available in Themes.