- 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 Vite + React 19 project with Tailwind v4. This guide covers both a new project (via the CLI) and an existing app.
Prerequisites
- Vite with React 19 + TypeScript
- Tailwind CSS v4 installed
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 Vite app with Frakment installed.
Create Project
$ bun create vite@latest app -- --template react-ts cd app$ npm create vite@latest app -- --template react-ts cd app$ pnpm create vite@latest app -- --template react-ts cd app$ yarn create vite@latest app -- --template react-ts cd app
Add Components
$ bunx --bun frakment@latest init npx frakment@latest add button$ npx frakment@latest init npx frakment@latest add button$ pnpm dlx frakment@latest init npx frakment@latest add button$ yarn dlx frakment@latest init npx frakment@latest add button
Use it
import { Button } from "@/components/ui/button";
export default function App() {
return <Button>Hello, Frakment.</Button>;
}Existing Project
Add Frakment to a Vite app you already created.
Install Tailwind CSS
Follow the Tailwind v4 guide for Vite.
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": {
"@/*": ["./src/*"]
}
}
}import path from "path";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [react()],
resolve: {
alias: { "@": path.resolve(__dirname, "./src") },
},
});Add a component
$ bunx --bun frakment@latest add button$ npx frakment@latest add button$ pnpm dlx frakment@latest add button$ yarn dlx frakment@latest add button
Project structure
After npm create vite, your project will have:
Verify
After installing your first component, confirm the setup:
ls src/components/ui/button.tsxThen import and render it in App.tsx. 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 both tsconfig.json and vite.config.ts define the @ alias. Vite needs the runtime alias, TypeScript needs the types alias.
Next
- Theming - customize tokens and dark mode
- Components - browse the catalog