Astro
Install and configure Astro.
Note: The following guide is for Tailwind v4. If you are using Tailwind v3, use [email protected]
.
Create project
Start by creating a new Astro project:
pnpm createastro@latest astro-app --template with-tailwindcss --install --add vue --git
Edit tsconfig.json file
Add the following code to the tsconfig.json
file to resolve paths:
tsconfig.json
ts
{
"compilerOptions": {
// ...
"baseUrl": ".",
"paths": {
"@/*": [
"./src/*"
]
}
// ...
}
}
Run the CLI
Run the shadcn
init command to setup your project:
pnpm dlx shadcn-vue@latest init
Add Components
You can now start adding components to your project.
pnpm dlx shadcn-vue@latest add button
The command above will add the Button
component to your project. You can then import it like this:
astro
---
import { Button } from "@/components/ui/button"
---
<html lang="en">
<head>
<title>Astro</title>
</head>
<body>
<Button>Hello World</Button>
</body>
</html>