A modern, open-source component library and starter kit for building stunning Astro.js websites in minutes. Built AI-friendly for seamless development with Claude, Cursor, and other coding assistants.
AstroDeck provides pre-built, production-ready components that help you launch landing pages, SaaS websites, and marketing sites faster. Built with Astro, Tailwind CSS, and shadcn/ui components.
- π€ AI-Friendly Development - AGENTS.md standard + dedicated Claude Code Agent helps you build faster with any AI assistant
- 15+ Pre-built Sections - Heroes, CTAs, Pricing Tables, Testimonials, Newsletters, and more
- Multiple Layout Templates - Boxed, Full-Width, Minimal, and Auth layouts for different page types
- Fully Responsive - Mobile-first design that looks great on all devices
- Dark Mode Support - Built-in theme switching with persistent preferences
- TypeScript - Full type safety throughout the codebase
- shadcn/ui Components - Beautiful, accessible React components integrated with Astro
- Lightning Fast - Astro's zero-JS by default approach for optimal performance
- SEO Optimized - Built-in OpenGraph, Twitter Cards, sitemap, RSS feed, and canonical URLs
- Code Quality Tools - ESLint and Prettier configured for Astro and TypeScript
- Easy Customization - Tailwind CSS for rapid styling adjustments
- Production Ready - Optimized builds with analytics integration
- Prerequisites
- Quick Start
- Installation
- Development
- Project Structure
- Usage Guide
- Component Library
- Customization
- Building for Production
- Deployment
- Troubleshooting
- AI-Friendly Development
- Contributing
- License
Before you begin, ensure you have the following installed on your machine:
- Node.js - Version 18.17.0 or higher (latest LTS recommended)
- npm - Comes with Node.js (or use yarn/pnpm)
- Git - For cloning the repository
To check your Node.js version, run:
node --versionIf you need to install or update Node.js, visit nodejs.org.
Important: AstroDeck uses the latest versions of Astro and Tailwind CSS. Always run npm install to get the most recent versions.
Get AstroDeck running in 3 steps:
# 1. Create a new project using degit
npx degit holger1411/astrodeck my-project
cd my-project
# 2. Install dependencies
npm install
# 3. Start the development server
npm run devOpen your browser and navigate to http://localhost:4321 to see your site!
The fastest way to get started - no git history, clean project:
# Create a new project
npx degit holger1411/astrodeck my-project
cd my-project
# Install dependencies
npm install
# Start developing
npm run devDownload the latest release directly:
# Download the latest version
wget https://github.com/holger1411/astrodeck/archive/refs/tags/v1.3.0.zip
# Extract
unzip v1.3.0.zip
cd astrodeck-1.3.0
# Install and run
npm install
npm run dev# Clone the repository
git clone https://github.com/holger1411/astrodeck.git my-project
# Navigate into the directory
cd astrodeck
# Install dependencies
npm install- Click the "Use this template" button on GitHub
- Create a new repository from the template
- Clone your new repository
- Install dependencies with
npm install
- Download the ZIP file from GitHub
- Extract it to your desired location
- Open terminal in the extracted folder
- Run
npm install
npm run devThis command:
- Starts a local development server
- Watches for file changes and auto-reloads
- Makes your site available at
http://localhost:4321 - Provides hot module replacement for instant updates
Expected output:
π astro v5.x.x started in 234ms
β Local http://localhost:4321/
β Network use --host to expose
Note: Version numbers will vary based on your installed Astro version. AstroDeck always uses the latest stable release.
npm startThis is an alias for npm run dev and does the same thing.
- Auto-reload: Changes to
.astro,.tsx, and.cssfiles trigger automatic browser refresh - Error handling: Check the terminal for build errors and warnings
- Port in use?: If port 4321 is busy, Astro will automatically use the next available port
Understanding the folder structure helps you navigate and customize AstroDeck:
astrodeck/
βββ public/ # Static assets (fonts, images, favicon)
β βββ favicon.svg
β βββ fonts/
βββ src/
β βββ components/ # Reusable components
β β βββ sections/ # Page sections (Hero, CTA, etc.)
β β β βββ Hero.astro
β β β βββ CTA.astro
β β β βββ Features.astro
β β β βββ Pricing.astro
β β β βββ Testimonials.astro
β β β βββ LogoCloud.astro
β β β βββ ContentBlock.astro
β β βββ ui/ # shadcn/ui components
β β β βββ button.tsx
β β β βββ card.tsx
β β β βββ badge.tsx
β β β βββ input.tsx
β β β βββ label.tsx
β β βββ Header.astro # Main site header
β β βββ Footer.astro # Main site footer
β β βββ ThemeToggle.astro
β β βββ LoginForm.tsx # Example React component
β βββ layouts/ # Page layout templates
β β βββ BaseLayout.astro # Boxed layout (max-w-5xl)
β β βββ FullWidthLayout.astro # Full-width layout
β β βββ MinimalLayout.astro # No header/footer (404, standalone)
β β βββ AuthLayout.astro # Auth pages (no header/footer)
β β βββ ArticleLayout.astro # Blog/article layout
β βββ pages/ # File-based routing
β β βββ index.astro # Homepage (/)
β β βββ sections.astro # Section library (/sections)
β β βββ blog/ # Blog pages
β β βββ 404.astro # Custom 404 page
β β βββ login.astro # Login page (/login)
β β βββ privacy.astro # Privacy page (/privacy)
β β βββ rss.xml.ts # RSS feed endpoint
β βββ styles/ # Global styles
β β βββ globals.css # Tailwind + custom styles
β βββ lib/ # Utilities
β β βββ utils.ts # Helper functions
β βββ env.d.ts # TypeScript definitions
βββ astro.config.mjs # Astro configuration
βββ tailwind.config.mjs # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
βββ package.json # Dependencies and scripts
src/pages/- Each.astrofile becomes a route (index.astro β/, login.astro β/login)src/components/sections/- Copy-paste ready sections for building pagessrc/layouts/- Wrapper templates that provide consistent structurepublic/- Files served as-is (no processing)
Astro uses file-based routing. Create a new file in src/pages/ to add a new route.
Example: Creating an About page
Create src/pages/about.astro:
---
import BaseLayout from "@/layouts/BaseLayout.astro";
---
<BaseLayout
title="About Us"
description="Learn more about our mission and team"
>
<div class="py-16">
<h1 class="text-4xl font-bold mb-6">About AstroDeck</h1>
<p class="text-lg text-muted-foreground">
We're building the best component library for Astro.
</p>
</div>
</BaseLayout>Now visit http://localhost:4321/about to see your new page!
AstroDeck components are modular and easy to use. Import them into your pages.
Example: Adding a Hero section
---
import BaseLayout from "@/layouts/BaseLayout.astro";
import Hero from "@/components/sections/Hero.astro";
import Features from "@/components/sections/Features.astro";
---
<BaseLayout title="Home" description="Welcome to our website">
<Hero />
<Features />
</BaseLayout>Example: Using UI components
---
import { Button } from "@/components/ui/button";
import { Badge } from "@/components/ui/badge";
---
<div>
<Badge>New</Badge>
<h2>Featured Product</h2>
<Button>Get Started</Button>
</div>Layouts provide consistent page structure. AstroDeck includes several layouts:
Centered content with max-width constraint. Best for content-focused pages.
---
import BaseLayout from "@/layouts/BaseLayout.astro";
---
<BaseLayout title="My Page" description="Page description">
<!-- Content is centered with max-w-5xl -->
<h1>Welcome</h1>
</BaseLayout>Full-width layout for showcase pages. Used in the sections library.
---
import FullWidthLayout from "@/layouts/FullWidthLayout.astro";
---
<FullWidthLayout title="Sections" description="Component library">
<!-- Content spans full width -->
</FullWidthLayout>Minimal layout without header/footer. Perfect for login, signup, and auth flows.
---
import AuthLayout from "@/layouts/AuthLayout.astro";
---
<AuthLayout title="Login">
<!-- No header or footer, just your content -->
<LoginForm />
</AuthLayout>Full-width layout without header or footer. Ideal for standalone pages like 404, maintenance, or landing pages.
---
import MinimalLayout from "@/layouts/MinimalLayout.astro";
---
<MinimalLayout title="Page Not Found" noindex={true}>
<!-- Complete control over the viewport -->
<div class="flex items-center justify-center min-h-screen">
<h1>404 - Page Not Found</h1>
</div>
</MinimalLayout>AstroDeck uses Tailwind CSS for styling. Here's how to customize:
AstroDeck uses Tailwind CSS v4 with the modern OKLCH color format. Edit src/styles/globals.css:
@theme {
/* Light mode colors */
--color-background: oklch(100% 0 0);
--color-foreground: oklch(9.8% 0.0016 286.75);
--color-primary: oklch(11.2% 0.0079 286.75); /* Change this */
--color-primary-foreground: oklch(98% 0.0011 286.75);
/* ... more colors */
}
.dark {
/* Dark mode overrides */
--color-background: oklch(1.5% 0 0);
--color-foreground: oklch(98% 0 0);
--color-primary: oklch(98% 0 0); /* Dark mode primary */
--color-primary-foreground: oklch(1.5% 0 0);
/* ... more colors */
}OKLCH Format: oklch(lightness% chroma hue)
- Lightness: 0-100% (0 = black, 100 = white)
- Chroma: Color intensity (0 = grayscale, higher = more vivid)
- Hue: Color angle in degrees (0-360)
- Add font files to
public/fonts/ - Update
src/styles/globals.css:
@font-face {
font-family: 'MyFont';
src: url('/fonts/MyFont.woff2') format('woff2');
}
body {
font-family: 'MyFont', sans-serif;
}Add global styles to src/styles/globals.css:
.custom-gradient {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}Then use in components:
<div class="custom-gradient p-12">
<h1>Custom styled section</h1>
</div>AstroDeck includes 15+ production-ready sections. Visit /sections in your browser to see all components with live previews.
- Centered with Badge - Classic hero with announcement badge
- Left Aligned - Split layout with content and visual
- Minimal with Stats - Clean design with social proof metrics
- Simple Centered - Focused conversion section
- Split with Features - CTA with feature highlights
- Banner Style - Bottom banner for conversions
- AstroDeck Open Source - Free tier showcase
- Three Column - Standard pricing grid
- Comparison Table - Feature comparison layout
- Monthly/Yearly Toggle - Pricing with billing toggle
- Grid Layout - Multiple testimonials in a grid
- Featured Single - Highlight one customer story
- Horizontal Scroll - Scrollable testimonial cards
- Simple Inline - Classic email capture
- Split with Visual - Newsletter with image
- Bottom Bar - Minimal footer signup
Copy any section from /sections or use them directly:
---
import BaseLayout from "@/layouts/BaseLayout.astro";
import Hero from "@/components/sections/Hero.astro";
import Pricing from "@/components/sections/Pricing.astro";
import CTA from "@/components/sections/CTA.astro";
---
<BaseLayout title="Pricing" description="Choose your plan">
<Hero />
<Pricing />
<CTA />
</BaseLayout>AstroDeck uses CSS variables for theming, making it easy to switch between light and dark modes.
Edit src/styles/globals.css using the OKLCH color format (Tailwind v4):
@theme {
/* Light mode colors */
--color-background: oklch(100% 0 0);
--color-foreground: oklch(9.8% 0.0016 286.75);
--color-primary: oklch(11.2% 0.0079 286.75);
--color-primary-foreground: oklch(98% 0.0011 286.75);
--color-secondary: oklch(96.1% 0.0011 286.75);
--color-muted: oklch(96.1% 0.0011 286.75);
/* Add more custom colors */
}
.dark {
/* Dark mode overrides */
--color-background: oklch(1.5% 0 0);
--color-foreground: oklch(98% 0 0);
--color-primary: oklch(98% 0 0);
--color-primary-foreground: oklch(1.5% 0 0);
}Why OKLCH? Better perceptual uniformity than HSL. Colors appear more consistent to the human eye.
All components are open and customizable. Simply edit the files in src/components/.
Example: Customizing the Hero
Edit src/components/sections/Hero.astro:
<section class="py-20 px-6">
<div class="max-w-7xl mx-auto text-center">
<h1 class="text-6xl font-bold mb-6">
Your Custom Headline Here
</h1>
<p class="text-xl text-muted-foreground mb-8">
Your custom description
</p>
<a href="/signup" class="btn btn-primary">
Get Started Free
</a>
</div>
</section>AstroDeck includes Vercel Analytics integration. To enable:
- Deploy to Vercel
- Analytics are automatically enabled
For other analytics platforms:
Google Analytics:
Add to src/layouts/BaseLayout.astro:
<head>
<!-- Existing head content -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GA_MEASUREMENT_ID');
</script>
</head>npm run buildThis command:
- Compiles your Astro site to static HTML/CSS/JS
- Optimizes assets (images, fonts, scripts)
- Outputs production files to the
dist/folder - Performs TypeScript type checking
Expected output:
building client (vite)
building server (vite)
generating static routes
βΆ src/pages/index.astro
ββ /index.html (+234ms)
βΆ src/pages/login.astro
ββ /login/index.html (+12ms)
β Completed in 3.45s.
Test your production build locally before deploying:
npm run previewThis starts a local server serving your dist/ folder at http://localhost:4321.
- Image Optimization: Use Astro's
<Image />component for automatic optimization - Remove unused CSS: Tailwind automatically purges unused styles in production
- Bundle size: Check
dist/folder size - should be < 500KB for most sites - Lighthouse scores: Run audits with Chrome DevTools
AstroDeck works with any static hosting provider. Here are the most popular options:
Why Vercel?
- Free for personal projects
- Automatic deployments from Git
- Built-in analytics
- Global CDN
Steps:
- Push your code to GitHub
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/yourusername/your-repo.git
git push -u origin main- Visit vercel.com
- Click "Import Project"
- Select your GitHub repository
- Click "Deploy"
Done! Your site is live in ~30 seconds.
- Push to GitHub (see above)
- Visit netlify.com
- Click "Add new site" β "Import an existing project"
- Connect GitHub and select your repo
- Build settings (auto-detected):
- Build command:
npm run build - Publish directory:
dist
- Build command:
- Click "Deploy"
# Install Wrangler CLI
npm install -g wrangler
# Login to Cloudflare
wrangler login
# Deploy
npx wrangler pages deploy dist- Install the GitHub Pages adapter:
npm install --save-dev @astrojs/github-pages- Update
astro.config.mjs:
import { defineConfig } from 'astro/config';
export default defineConfig({
site: 'https://yourusername.github.io',
base: '/your-repo-name',
});- Create
.github/workflows/deploy.yml:
name: Deploy to GitHub Pages
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npm run build
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist- Enable GitHub Pages in your repository settings
AstroDeck works with:
- AWS Amplify - Connect GitHub and deploy
- Render - Static site hosting
- Digital Ocean App Platform
- Firebase Hosting
- Surge.sh - Simple CLI deployment
All require the same build settings:
- Build command:
npm run build - Publish directory:
dist - Node version: 18 or higher
Problem: Error: listen EADDRINUSE: address already in use :::4321
Solution:
# Kill the process using port 4321
lsof -ti:4321 | xargs kill
# Or use a different port
npm run dev -- --port 3000Problem: Cannot find module '@/components/...'
Solution:
# Delete node_modules and reinstall
rm -rf node_modules package-lock.json
npm installProblem: Theme toggle doesn't switch modes
Solution:
- Check browser console for JavaScript errors
- Ensure
ThemeToggle.astroscript is running - Clear browser cache and localStorage
Problem: tsc errors during build
Solution:
# Check for type errors
npm run build
# Fix import paths - use @/ for src directory
# Wrong: import Header from '../components/Header.astro'
# Right: import Header from '@/components/Header.astro'Problem: Tailwind classes not working
Solution:
- Check if file is included in
tailwind.config.mjs:
content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}']- Restart dev server after config changes
- Check for typos in class names
- Documentation: docs.astro.build
- GitHub Issues: Report a bug
- Discord: Join Astro community
AstroDeck is designed to work seamlessly with AI coding assistants like Claude, ChatGPT, Cursor, GitHub Copilot, and others. We've included specialized documentation to help AI tools understand the project structure and provide better assistance.
AstroDeck includes a dedicated Claude Code Agent that acts as your personal project expert. The agent understands AstroDeck's architecture, conventions, and best practicesβhelping you build faster while maintaining quality.
| Category | Features |
|---|---|
| π§ Development | Create pages, components, layouts following project patterns |
| π¨ Design System | Maintain color, spacing, and typography consistency |
| π‘οΈ Security | Warn about XSS, missing SRI, insecure resources |
| βΏ Accessibility | Check WCAG compliance, contrast ratios, ARIA labels |
| π SEO | Verify meta tags, OpenGraph, heading hierarchy |
| β‘ Performance | Identify unoptimized images, missing lazy loading |
The agent is located at .claude/agents/astrodeck.md and works automatically with Claude Code.
Automatic Usage: When you work on AstroDeck with Claude Code, the agent activates automatically for relevant tasks.
Explicit Usage:
> Use the astrodeck agent to create a new pricing page
> Have astrodeck review my component for accessibility issues
> Ask astrodeck to check the SEO of this page
Model Selection: The agent supports different models based on your needs:
- Sonnet (default): Balanced for most development tasks
- Opus: Complex architectural decisions and deep analysis
- Haiku: Quick lookups and simple operations
> Use astrodeck with opus to review the project architecture
Proactive Warnings: The agent warns you before potential issues become problems:
π‘οΈ SECURITY WARNING
Issue: External script without Subresource Integrity (SRI)
Risk: Script could be modified by attackers
Fix: Add integrity attribute or host script locally
βΏ ACCESSIBILITY WARNING
Issue: Image missing alt text
Impact: Screen readers cannot describe the image
Fix: Add descriptive alt attribute
π SEO WARNING
Issue: Page missing OpenGraph meta tags
Impact: Poor social media sharing appearance
Fix: Add og:title, og:description, og:image
DRY Enforcement: The agent detects code duplication and suggests improvements:
β οΈ DRY WARNING
Similar code found in:
- src/components/sections/Hero.astro
- src/components/sections/CTA.astro
Recommendation: Extract into a reusable component
For the best experience, the agent can leverage these optional MCP servers:
Context7 (Documentation):
// For up-to-date Astro, Tailwind, React, shadcn/ui docs
// https://github.com/upstash/context7Lighthouse MCP (Audits):
{
"mcpServers": {
"lighthouse": {
"command": "npx",
"args": ["@danielsogl/lighthouse-mcp@latest"]
}
}
}AstroDeck follows the AGENTS.md standard β an open format for guiding AI coding agents, used by 60,000+ open-source projects and stewarded by the Linux Foundation.
Think of AGENTS.md as a README for AI agents: a dedicated, predictable place to provide context and instructions.
| Tool | Support | Notes |
|---|---|---|
| OpenAI Codex | β Native | Reads AGENTS.md automatically |
| GitHub Copilot | β Native | Coding agent supports AGENTS.md |
| Cursor | β Native | Reads AGENTS.md and symlinks |
| Google Jules | β Native | Full AGENTS.md support |
| Gemini CLI | β Config | Via contextFileName setting |
| Windsurf | β Native | Reads AGENTS.md automatically |
| Zed | β Native | Priority-based file loading |
| Claude Code | β Symlink | Via PROJECT.md β AGENTS.md |
| Aider | β Config | Via read: AGENTS.md |
Plus many more: Factory, Amp, RooCode, Devin, Kilo Code, Warp, and others.
β See full list at agents.md
astrodeck/
βββ PROJECT.md # π― YOUR project customizations (HIGHEST PRIORITY)
βββ AGENTS.md # π AstroDeck defaults (all AI tools)
βββ .cursorrules # π Symlink β AGENTS.md (Cursor)
βββ .claude/agents/
βββ astrodeck.md # π€ Claude Code Agent (enhanced features)
Priority: HIGHEST - Overrides all other AI documentation.
Use this file to customize AstroDeck for YOUR project:
π¨ Design Customizations:
## Colors
Primary color: Vibrant electric blue (#0066FF) instead of default blueβοΈ Content Guidelines:
## Tone of Voice
- Style: Professional but friendly, conversational
- Audience: Tech-savvy startup founders
- Language: US English, avoid jargonπ Project-Specific Rules:
## Component Preferences
- All forms must include Zod validation
- All API calls must use TanStack QueryExample Use Case:
You want electric blue as your primary color. Add this to PROJECT.md:
## Design Customizations
Our brand color is electric blue (#0066FF). Use this for:
- All CTAs and primary buttons
- Link colors
- Active states and highlightsNow every AI assistant will use electric blue instead of AstroDeck's default!
See PROJECT.md for a complete template with examples.
The main configuration file containing:
- Project overview and tech stack (Astro v5, Tailwind v4)
- Code conventions and patterns
- Import aliases and file organization
- Do's and Don'ts for code generation
- Component templates and debugging checklists
Note: Instructions in PROJECT.md override these defaults.
Enhanced agent with AstroDeck-specific capabilities:
- Proactive security, accessibility, SEO warnings
- DRY enforcement and code review
- MCP server recommendations (Context7, Lighthouse)
Usage: Automatically activated when using Claude Code on AstroDeck.
For Developers:
- β Faster code generation that follows project conventions
- β Consistent code style across AI-assisted changes
- β Better suggestions from AI tools
- β Reduced debugging time
- β Easier onboarding for new contributors
For AI Assistants:
- π― Understanding of project structure and patterns
- π― Knowledge of tech stack specifics (Tailwind v4, Astro v5)
- π― Awareness of coding conventions (imports, styling, types)
- π― Context for generating appropriate solutions
- π― Ability to provide better explanations
When working with AI assistants on AstroDeck:
- Ask specific questions - AI tools have context from documentation files
- Reference conventions - AI will follow the patterns defined in
.cursorrules - Request code generation - AI understands component structure and will generate compatible code
- Debug with context - AI knows common pitfalls and can suggest fixes
You: "Create a new pricing section component"
AI: *Generates component following AstroDeck patterns*
- Uses @/ imports
- Includes TypeScript types
- Applies proper styling with Tailwind v4
- Follows responsive design patterns
- Matches existing component structure
You: "Why am I getting Tailwind errors?"
AI: *Checks against AGENTS.md knowledge*
- Recognizes Tailwind v4 is used
- Knows about @theme configuration
- Suggests OKLCH color format
- References globals.css structure
If you find ways to improve AI assistance for AstroDeck:
- Suggest updates to
AGENTS.mdfor better conventions - Improve the Claude Code agent in
.claude/agents/astrodeck.md - Report AI-related issues or confusions
- Share successful AI interaction patterns
We believe AI-assisted development should be a first-class experience!
We welcome contributions! Here's how you can help:
- Check if the issue already exists
- Create a new issue with:
- Clear description
- Steps to reproduce
- Expected vs actual behavior
- Screenshots if applicable
- Open an issue with the "enhancement" label
- Describe the feature and its use case
- Discuss implementation approach
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes
- Test thoroughly
- Commit with clear messages:
git commit -m "Add amazing feature" - Push to your fork:
git push origin feature/amazing-feature
- Open a Pull Request
- Follow the existing code style
- Use TypeScript for type safety
- Test on both light and dark modes
- Ensure responsive design (mobile, tablet, desktop)
- Update documentation for new features
AstroDeck is open source software licensed under the MIT License.
This means you can:
- β Use commercially
- β Modify
- β Distribute
- β Use privately
Attribution is appreciated but not required!
AstroDeck is built with amazing open-source projects:
- Astro - The web framework for content-driven websites
- Tailwind CSS - Utility-first CSS framework
- shadcn/ui - Beautifully designed components
- Radix UI - Unstyled, accessible components
- Lucide Icons - Beautiful icon library
If you find AstroDeck helpful, please:
- β Star the repository on GitHub
- π¦ Share it on social media
- π Write about it on your blog
- π€ Contribute improvements
Built with β€οΈ by the AstroDeck team
Start building your next amazing website today! π
