Requirements
- Astro 4.0 or later
- Tailwind CSS v4
Start fresh
Create a new Astro project with Bearnie pre-configured:
npm create bearnie my-app npm create bearnie my-app
npm create bearnie my-app
bun create bearnie my-app bun create bearnie my-app
bun create bearnie my-app
pnpm create bearnie my-app pnpm create bearnie my-app
pnpm create bearnie my-app
yarn create bearnie my-app yarn create bearnie my-app
yarn create bearnie my-app
Then navigate to your project and start developing:
Add to existing project
Run the init command to configure your existing Astro project:
pnpm dlx bearnie add styles pnpm dlx bearnie add styles
pnpm dlx bearnie add styles
yarn dlx bearnie add styles yarn dlx bearnie add styles
yarn dlx bearnie add styles
Import the styles in your main CSS file:
@import "tailwindcss";
@import "./bearnie.css";
@import "tailwindcss";
@import "./bearnie.css";
npx bearnie add button card dialog npx bearnie add button card dialog
npx bearnie add button card dialog
bunx bearnie add button card dialog bunx bearnie add button card dialog
bunx bearnie add button card dialog
pnpm dlx bearnie add button card dialog pnpm dlx bearnie add button card dialog
pnpm dlx bearnie add button card dialog
yarn dlx bearnie add button card dialog yarn dlx bearnie add button card dialog
yarn dlx bearnie add button card dialog
Manual setup
1. Add the cn utility
Create src/utils/cn.ts:
export function cn(...classes: (string | undefined | null | false)[]): string {
return classes.filter(Boolean).join(' ');
}
export function cn(...classes: (string | undefined | null | false)[]): string {
return classes.filter(Boolean).join(' ');
}
Add to your tsconfig.json:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
}
}
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
}
}
3. Add theme styles
Add the styles via CLI:
pnpm dlx bearnie add styles pnpm dlx bearnie add styles
pnpm dlx bearnie add styles
yarn dlx bearnie add styles yarn dlx bearnie add styles
yarn dlx bearnie add styles
Then import in your main CSS file:
@import "tailwindcss";
@import "./bearnie.css";
@import "tailwindcss";
@import "./bearnie.css";
4. Add components
Use the CLI or copy components from src/components/bearnie/ to your project.
npx bearnie add button card npx bearnie add button card
npx bearnie add button card
bunx bearnie add button card bunx bearnie add button card
bunx bearnie add button card
pnpm dlx bearnie add button card pnpm dlx bearnie add button card
pnpm dlx bearnie add button card
yarn dlx bearnie add button card yarn dlx bearnie add button card
yarn dlx bearnie add button card
src/
├── components/
│ └── bearnie/
│ ├── button/
│ │ └── Button.astro
│ └── card/
│ ├── Card.astro
│ ├── CardHeader.astro
│ └── CardContent.astro
├── styles/
│ └── bearnie.css
└── utils/
└── cn.ts
src/
├── components/
│ └── bearnie/
│ ├── button/
│ │ └── Button.astro
│ └── card/
│ ├── Card.astro
│ ├── CardHeader.astro
│ └── CardContent.astro
├── styles/
│ └── bearnie.css
└── utils/
└── cn.ts
Updating components
Components and styles are copied to your project — you own them. They don’t auto-update when Bearnie releases changes.
To update a component or styles:
npx bearnie add button --yes npx bearnie add button --yes
npx bearnie add button --yes
bunx bearnie add button --yes bunx bearnie add button --yes
bunx bearnie add button --yes
pnpm dlx bearnie add button --yes pnpm dlx bearnie add button --yes
pnpm dlx bearnie add button --yes
yarn dlx bearnie add button --yes yarn dlx bearnie add button --yes
yarn dlx bearnie add button --yes
If you’ve customized a component, running this will overwrite your changes. Back up your modifications first, then merge manually after updating.
This is intentional. You control when updates happen and what gets changed.