- Accordion
- Attachment
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Card
- Checkbox
- Code Block
- Collapsible
- Dialog
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Label
- Marker
- Message
- Number Flow
- Pagination
- Popover
- Progress
- Radio Group
- Select
- Slider
- Sonner
- Spinner
- Switch
- Tooltip
- Separator
- Sheet
- Tabs
- Textarea
- Toggle
- Toggle Group
- Trace
Frakment requires Tailwind v4. The theme block uses @theme inline, @utility, and @custom-variant — none of these exist in Tailwind v3. This page covers how to verify, migrate, and troubleshoot.
Prerequisites
- Tailwind CSS 4.0 or newer
- PostCSS 8 (if you use the PostCSS pipeline)
- A CSS entry file that contains
@import "tailwindcss";
Verify the version
npm ls tailwindcssOutput must show tailwindcss@^4. If it shows ^3, follow the migration below.
What Frakment uses from v4
| Feature | Used in | v3 equivalent |
|---|---|---|
@theme inline | Token mapping | None |
@utility | no-scrollbar, scroll-fade, container, step | plugin() |
@custom-variant | dark, data-* variants | addVariant() |
@apply | Component classes | Same |
None of the first three work in v3. There is no shim — the theme block is v4-only.
Migrating from v3
Install v4 packages
$ bun add tailwindcss@latest @tailwindcss/postcss npm uninstall tailwindcss@3 postcss autoprefixer$ npm install tailwindcss@latest @tailwindcss/postcss npm uninstall tailwindcss@3 postcss autoprefixer$ pnpm add tailwindcss@latest @tailwindcss/postcss npm uninstall tailwindcss@3 postcss autoprefixer$ yarn add tailwindcss@latest @tailwindcss/postcss npm uninstall tailwindcss@3 postcss autoprefixer
Update PostCSS config
export default {
plugins: {
"@tailwindcss/postcss": {},
},
};Remove tailwindcss and autoprefixer from the plugin list.
Delete tailwind.config.js
Tailwind v4 does not need a config file for Frakment. Everything lives in CSS.
Replace @tailwind directives
In your CSS entry file:
/* v3 */
@tailwind base;
@tailwind components;
@tailwind utilities;
/* v4 */
@import "tailwindcss";Reinstall Frakment components
$ bunx --bun frakment@latest add <component> --overwrite$ npx frakment@latest add <component> --overwrite$ pnpm dlx frakment@latest add <component> --overwrite$ yarn dlx frakment@latest add <component> --overwrite
v4 registry files use @theme, @utility, and @custom-variant.
Theme block placement
The Frakment theme block must come after @import "tailwindcss"; and after any other imports. If it comes first, token resolution fails:
@import "tailwindcss";
/* ==== FRAKMENT THEME START ==== */
/* ... tokens, @theme, @utility ... */
/* ==== FRAKMENT THEME END ==== */npx frakment init handles this automatically.
Common errors
Tailwind v3 is installed. Upgrade: npm install tailwindcss@latest.
Your CSS entry file is missing the import. Add @import "tailwindcss"; at the top, before the Frakment theme block.
The theme block is placed before @import "tailwindcss";. Move it after all imports. Tailwind cannot resolve tokens declared before the import.
Check postcss.config.mjs. Only @tailwindcss/postcss should be registered. Old tailwindcss and autoprefixer plugins must be removed.
Next
- Theming - token reference
- Dark mode - framework-specific wiring
- Tailwind CSS v4 docs - upstream reference