Astro Integration

Astro components and layouts for building content-focused sites with Vanilla Breeze.

Overview

The Astro integration provides typed components and layouts that follow Vanilla Breeze conventions. All components support Astro's islands architecture and work with content collections.

Location: /integrations/astro/

Installation

Copy the astro/ directory into your Astro project's src/ folder:

Then import styles in your main CSS or layout:

Components

BaseHead

Standard <head> setup with meta tags, OG data, and theme initialization.

Props:

  • title - Page title (required)
  • description - Meta description (required)
  • image - OG image URL (optional)
  • canonicalURL - Canonical URL (optional)

ThemeToggle

Theme switcher button using the theme-picker web component.

NavTree

Tree navigation from structured data with automatic active state detection.

Props:

  • items - Navigation tree array (required)
  • currentPath - Current URL path (optional, auto-detected)
  • density - 'default' | 'compact' (optional)

PageToc

Auto-generated table of contents from page headings.

Props:

  • headings - Array from getHeadings() (required)
  • label - Section label (optional)
  • depth - Max heading depth (optional, default: 3)

Card

Wrapper for the layout-card custom element.

Props:

  • variant - 'default' | 'outlined' | 'elevated' (optional)
  • interactive - Makes entire card clickable (optional)
  • href - Link URL when interactive (optional)

FormField

Wrapper for the form-field custom element.

Props:

  • label - Field label (required)
  • name - Input name (required)
  • type - Input type (optional, default: 'text')
  • required - Required field (optional)
  • hint - Helper text (optional)
  • error - Error message (optional)

CodeBlock & BrowserWindow

Helper components for demos and documentation.

Layouts

BaseLayout

Minimal page structure with header and footer.

DocsLayout

Documentation page with sidebar navigation and table of contents.

BlogLayout

Blog post layout with metadata and author info.

LandingLayout

Marketing page with hero support and multi-column footer.

Styles

Import astro-overrides.css for Astro-specific styles:

  • View transition animations
  • Island loading states
  • Content collection styling
  • Light/dark code block switching

TypeScript Support

The integration includes TypeScript types for all component props. Import from index.ts: