@@ -7,8 +7,9 @@ icon: Download
77import { Tabs , Tab } from " fumadocs-ui/components/tabs" ;
88
99Babelize Elements drops into any React + Tailwind CSS project — Next.js, Vite, Remix,
10- or anything else that bundles React. The package ships TypeScript types, both ESM and
11- CJS builds, and no runtime dependencies beyond React and Tailwind CSS.
10+ or anything else that bundles React. The package ships TypeScript types and both ESM and
11+ CJS builds. Runtime dependencies are small and standard in the shadcn ecosystem:
12+ ` motion ` for animation and ` lucide-react ` for icons.
1213
1314## Package Manager
1415
@@ -57,6 +58,99 @@ This step is only for the npm package. Components installed with the
5758[ shadcn CLI] ( /docs/getting-started/shadcn-cli ) live in your own source tree, which
5859Tailwind already scans.
5960
61+ ## Theme tokens
62+
63+ Components are styled with [ shadcn/ui] ( https://ui.shadcn.com/docs/theming ) semantic
64+ tokens — ` bg-popover ` , ` text-muted-foreground ` , ` ring-ring ` , and so on — so they
65+ pick up your app's theme, radius, and dark mode automatically.
66+
67+ ** Already using shadcn/ui?** Nothing to do: ` shadcn init ` defined the tokens.
68+
69+ ** Not using shadcn/ui?** Add the tokens once to the CSS file that imports Tailwind.
70+ This is the shadcn neutral theme; change any value to match your brand.
71+
72+ ``` css title="app/globals.css"
73+ /* Make `dark:` follow the `.dark` class, as the tokens below do. */
74+ @custom-variant dark (&:is(.dark *));
75+
76+ :root {
77+ --radius : 0.625rem ;
78+ --background : oklch(1 0 0 );
79+ --foreground : oklch(0.145 0 0 );
80+ --card : oklch(1 0 0 );
81+ --card-foreground : oklch(0.145 0 0 );
82+ --popover : oklch(1 0 0 );
83+ --popover-foreground : oklch(0.145 0 0 );
84+ --primary : oklch(0.205 0 0 );
85+ --primary-foreground : oklch(0.985 0 0 );
86+ --secondary : oklch(0.97 0 0 );
87+ --secondary-foreground : oklch(0.205 0 0 );
88+ --muted : oklch(0.97 0 0 );
89+ --muted-foreground : oklch(0.556 0 0 );
90+ --accent : oklch(0.97 0 0 );
91+ --accent-foreground : oklch(0.205 0 0 );
92+ --destructive : oklch(0.577 0.245 27.325 );
93+ --border : oklch(0.922 0 0 );
94+ --input : oklch(0.922 0 0 );
95+ --ring : oklch(0.708 0 0 );
96+ }
97+
98+ .dark {
99+ --background : oklch(0.145 0 0 );
100+ --foreground : oklch(0.985 0 0 );
101+ --card : oklch(0.205 0 0 );
102+ --card-foreground : oklch(0.985 0 0 );
103+ --popover : oklch(0.205 0 0 );
104+ --popover-foreground : oklch(0.985 0 0 );
105+ --primary : oklch(0.922 0 0 );
106+ --primary-foreground : oklch(0.205 0 0 );
107+ --secondary : oklch(0.269 0 0 );
108+ --secondary-foreground : oklch(0.985 0 0 );
109+ --muted : oklch(0.269 0 0 );
110+ --muted-foreground : oklch(0.708 0 0 );
111+ --accent : oklch(0.269 0 0 );
112+ --accent-foreground : oklch(0.985 0 0 );
113+ --destructive : oklch(0.704 0.191 22.216 );
114+ --border : oklch(1 0 0 / 10% );
115+ --input : oklch(1 0 0 / 15% );
116+ --ring : oklch(0.556 0 0 );
117+ }
118+
119+ @theme inline {
120+ --radius-sm: calc(var(--radius) - 4px);
121+ --radius-md: calc(var(--radius) - 2px);
122+ --radius-lg: var(--radius);
123+ --radius-xl: calc(var(--radius) + 4px);
124+ --color-background: var(--background);
125+ --color-foreground: var(--foreground);
126+ --color-card: var(--card);
127+ --color-card-foreground: var(--card-foreground);
128+ --color-popover: var(--popover);
129+ --color-popover-foreground: var(--popover-foreground);
130+ --color-primary: var(--primary);
131+ --color-primary-foreground: var(--primary-foreground);
132+ --color-secondary: var(--secondary);
133+ --color-secondary-foreground: var(--secondary-foreground);
134+ --color-muted: var(--muted);
135+ --color-muted-foreground: var(--muted-foreground);
136+ --color-accent: var(--accent);
137+ --color-accent-foreground: var(--accent-foreground);
138+ --color-destructive: var(--destructive);
139+ --color-border: var(--border);
140+ --color-input: var(--input);
141+ --color-ring: var(--ring);
142+ }
143+ ```
144+
145+ On Tailwind v3, map the same variables under ` theme.extend.colors ` in
146+ ` tailwind.config.js ` , as in the
147+ [ shadcn v3 guide] ( https://v3.shadcn.com/docs/theming ) . Components are designed for
148+ Tailwind v4; on v3 they work, but some v4-only utilities (such as ` shadow-xs ` ) fall
149+ back to no effect.
150+
151+ Every component also takes a ` classNames ` prop for per-part overrides, so you can
152+ restyle any slot without forking the source.
153+
60154## Install individual components
61155
62156Prefer installing components one at a time, straight into your codebase? Use the [ shadcn CLI] ( /docs/getting-started/shadcn-cli ) :
0 commit comments