- 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 Astro project with the React integration, React 19, and Tailwind v4.
Prerequisites
- Astro with the React integration
- 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 Astro project with Frakment installed.
Create Project
$ bun create astro@latest app cd app npx astro add react npx astro add tailwind$ npm create astro@latest app cd app npx astro add react npx astro add tailwind$ pnpm create astro@latest app cd app npx astro add react npx astro add tailwind$ yarn create astro@latest app cd app npx astro add react npx astro add tailwind
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 Hello() {
return <Button>Hello, Frakment.</Button>;
}---
import Hello from "@/components/Hello";
---
<Hello client:load />Existing Project
Add Frakment to an Astro app you already created.
Add React integration
$ bunx --bun astro add react$ npx astro add react$ pnpm dlx astro add react$ yarn dlx astro add react
Add Tailwind CSS
$ bunx --bun astro add tailwind$ npx astro add tailwind$ pnpm dlx astro add tailwind$ yarn dlx astro add tailwind
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:
{
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./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 astro and astro add react, your project will have:
Verify
After installing your first component, confirm the setup:
ls src/components/ui/button.tsxThen render the component with client:load in an Astro 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.
React components in Astro need a client directive. Use <Hello client:load /> (or client:visible, client:idle).
Next
- Theming - customize tokens and dark mode
- Components - browse the catalog