- 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 Gatsby 5+ project with React 19 and Tailwind v4. This guide covers both a new project via the CLI and an existing app.
Prerequisites
- Gatsby 5 or newer
- 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 Gatsby app with Frakment installed.
Create project
npm init gatsby
cd appInstall Tailwind v4
$ bun add tailwindcss@latest gatsby-plugin-postcss postcss$ npm install tailwindcss@latest gatsby-plugin-postcss postcss$ pnpm add tailwindcss@latest gatsby-plugin-postcss postcss$ yarn add tailwindcss@latest gatsby-plugin-postcss postcss
Add the plugin in gatsby-config.ts:
import type { GatsbyConfig } from "gatsby";
const config: GatsbyConfig = {
plugins: ["gatsby-plugin-postcss"],
};
export default config;Create src/styles/global.css:
@import "tailwindcss";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 Index() {
return (
<Bubble>
<BubbleContent>Hello, Frakment.</BubbleContent>
</Bubble>
);
}Existing Project
Add Frakment to a Gatsby app you already created.
Install Tailwind v4
$ bun add tailwindcss@latest gatsby-plugin-postcss postcss$ npm install tailwindcss@latest gatsby-plugin-postcss postcss$ pnpm add tailwindcss@latest gatsby-plugin-postcss postcss$ yarn add tailwindcss@latest gatsby-plugin-postcss postcss
Register gatsby-plugin-postcss in gatsby-config.ts.
Run frakment init
$ bunx --bun frakment@latest init$ npx frakment@latest init$ pnpm dlx frakment@latest init$ yarn dlx frakment@latest init
Point to src/styles/global.css when prompted. The CLI injects the theme block.
Configure the import alias
In tsconfig.json:
{
"compilerOptions": {
"baseUrl": "src",
"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
Project structure
Verify
ls src/components/ui/bubble.tsxThen render it in a page. If it renders without errors, you are ready.
Troubleshooting
Gatsby does not ship Tailwind v4 out of the box. Make sure gatsby-plugin-postcss is registered in gatsby-config.ts and restart with gatsby develop --clear-cache.
Gatsby puts source in src/. Set "baseUrl": "src" and "@/*": ["./*"] in tsconfig.json.
Next
- Theming - customize tokens and dark mode
- Components - browse the catalog
- Gatsby docs - framework reference