- 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 works in any Next.js 15+ project with React 19 and Tailwind v4. This guide covers both a new project (via the CLI) and an existing app.
Prerequisites
- Next.js 15 or newer (App Router or Pages Router)
- React 19
- TypeScript
- Tailwind CSS v4
Components target React 19 and Tailwind v4. For React 18, some components need forwardRef adjustments. For Tailwind v3, port the tokens from Theming manually.
Use the CLI
Scaffold a new Next.js app with Frakment installed.
Create Project
$ bunx --bun create-next-app@latest app --typescript --tailwind --app cd app$ npx create-next-app@latest app --typescript --tailwind --app cd app$ pnpm create next-app@latest app --typescript --tailwind --app cd app$ yarn create next-app@latest app --typescript --tailwind --app cd app
Add Components
$ bunx --bun frakment@latest init npx frakment@latest add bubble$ npx frakment@latest init npx frakment@latest add bubble$ pnpm dlx frakment@latest init npx frakment@latest add bubble$ yarn dlx frakment@latest init npx frakment@latest add bubble
Use it
import { Bubble, BubbleContent } from "@/components/ui/message";
export default function Page() {
return (
<Bubble>
<BubbleContent>Hello, Frakment.</BubbleContent>
</Bubble>
);
}Existing Project
Add Frakment to a Next.js app you already created.
Configure Tailwind CSS
Make sure Tailwind v4 is installed and globals.css is imported in your root layout.
Run frakment init
Run npx frakment@latest init — it injects the theme block into globals.css between FRAKMENT THEME markers. Alternatively, paste the block manually from Theming:
@import "tailwindcss";
/* ==== FRAKMENT THEME START ==== */
/* ... theme block ... */
/* ==== FRAKMENT THEME END ==== */See Manual for details.
Configure the import alias
In tsconfig.json:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
}
}Add a component
$ bunx --bun frakment@latest add bubble$ npx frakment@latest add bubble$ pnpm dlx frakment@latest add bubble$ yarn dlx frakment@latest add bubble
Import and use
import { Bubble, BubbleContent } from "@/components/ui/message";
export default function Page() {
return (
<Bubble>
<BubbleContent>Hello, Frakment.</BubbleContent>
</Bubble>
);
}Project structure
After create-next-app, your project will have:
Verify
After installing your first component, confirm the setup:
ls components/ui/bubble.tsxThen import and render it in a page. If it renders without errors, you're ready.
Troubleshooting
Run npx frakment@latest init again. It will create lib/utils.ts and update tsconfig.json.
Make sure globals.css includes the theme tokens from Theming.
Next
- Theming - customize tokens and dark mode
- Components - browse the catalog