@@ -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,96 @@ 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+ :root {
74+ --radius : 0.625rem ;
75+ --background : oklch(1 0 0 );
76+ --foreground : oklch(0.145 0 0 );
77+ --card : oklch(1 0 0 );
78+ --card-foreground : oklch(0.145 0 0 );
79+ --popover : oklch(1 0 0 );
80+ --popover-foreground : oklch(0.145 0 0 );
81+ --primary : oklch(0.205 0 0 );
82+ --primary-foreground : oklch(0.985 0 0 );
83+ --secondary : oklch(0.97 0 0 );
84+ --secondary-foreground : oklch(0.205 0 0 );
85+ --muted : oklch(0.97 0 0 );
86+ --muted-foreground : oklch(0.556 0 0 );
87+ --accent : oklch(0.97 0 0 );
88+ --accent-foreground : oklch(0.205 0 0 );
89+ --destructive : oklch(0.577 0.245 27.325 );
90+ --border : oklch(0.922 0 0 );
91+ --input : oklch(0.922 0 0 );
92+ --ring : oklch(0.708 0 0 );
93+ }
94+
95+ .dark {
96+ --background : oklch(0.145 0 0 );
97+ --foreground : oklch(0.985 0 0 );
98+ --card : oklch(0.205 0 0 );
99+ --card-foreground : oklch(0.985 0 0 );
100+ --popover : oklch(0.205 0 0 );
101+ --popover-foreground : oklch(0.985 0 0 );
102+ --primary : oklch(0.922 0 0 );
103+ --primary-foreground : oklch(0.205 0 0 );
104+ --secondary : oklch(0.269 0 0 );
105+ --secondary-foreground : oklch(0.985 0 0 );
106+ --muted : oklch(0.269 0 0 );
107+ --muted-foreground : oklch(0.708 0 0 );
108+ --accent : oklch(0.269 0 0 );
109+ --accent-foreground : oklch(0.985 0 0 );
110+ --destructive : oklch(0.704 0.191 22.216 );
111+ --border : oklch(1 0 0 / 10% );
112+ --input : oklch(1 0 0 / 15% );
113+ --ring : oklch(0.556 0 0 );
114+ }
115+
116+ @theme inline {
117+ --radius-sm: calc(var(--radius) - 4px);
118+ --radius-md: calc(var(--radius) - 2px);
119+ --radius-lg: var(--radius);
120+ --radius-xl: calc(var(--radius) + 4px);
121+ --color-background: var(--background);
122+ --color-foreground: var(--foreground);
123+ --color-card: var(--card);
124+ --color-card-foreground: var(--card-foreground);
125+ --color-popover: var(--popover);
126+ --color-popover-foreground: var(--popover-foreground);
127+ --color-primary: var(--primary);
128+ --color-primary-foreground: var(--primary-foreground);
129+ --color-secondary: var(--secondary);
130+ --color-secondary-foreground: var(--secondary-foreground);
131+ --color-muted: var(--muted);
132+ --color-muted-foreground: var(--muted-foreground);
133+ --color-accent: var(--accent);
134+ --color-accent-foreground: var(--accent-foreground);
135+ --color-destructive: var(--destructive);
136+ --color-border: var(--border);
137+ --color-input: var(--input);
138+ --color-ring: var(--ring);
139+ }
140+ ```
141+
142+ On Tailwind v3, map the same variables under ` theme.extend.colors ` in
143+ ` tailwind.config.js ` , as in the
144+ [ shadcn v3 guide] ( https://v3.shadcn.com/docs/theming ) . Components are designed for
145+ Tailwind v4; on v3 they work, but some v4-only utilities (such as ` shadow-xs ` ) fall
146+ back to no effect.
147+
148+ Every component also takes a ` classNames ` prop for per-part overrides, so you can
149+ restyle any slot without forking the source.
150+
60151## Install individual components
61152
62153Prefer installing components one at a time, straight into your codebase? Use the [ shadcn CLI] ( /docs/getting-started/shadcn-cli ) :
0 commit comments