โœฆ StealThis .dev

Astro + Tailwind Starter

Astro starter with Tailwind CSS integration, content collections, island architecture, and zero-JS-by-default static site generation.

Open in Lab
astro tailwindcss typescript
Targets: HTML

Code

Astro + Tailwind Starter

Astro ships zero JavaScript by default and lets you bring your favorite UI framework as interactive islands. Combined with Tailwind CSS and content collections, itโ€™s the ideal stack for content-driven sites.

Quick Start

npm create astro@latest my-site
cd my-site
npx astro add tailwind
npm run dev

The create astro CLI offers templates (minimal, blog, starlight). The astro add command auto-installs and configures integrations.

What You Get

  • Zero JS by default โ€” Static HTML output, no client runtime unless you opt in
  • Island Architecture โ€” Hydrate only the interactive components you need (client:load, client:visible, etc.)
  • Content Collections โ€” Type-safe Markdown/MDX with schema validation via Zod
  • Tailwind CSS โ€” Configured via @astrojs/tailwind integration
  • TypeScript โ€” First-class support with strict mode
  • SSG + SSR โ€” Static generation by default, with optional server rendering per route
  • View Transitions โ€” Built-in page transition API

Generated Project Structure

my-site/
โ”œโ”€โ”€ public/
โ”‚   โ””โ”€โ”€ favicon.svg
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ””โ”€โ”€ Card.astro
โ”‚   โ”œโ”€โ”€ content/
โ”‚   โ”‚   โ””โ”€โ”€ config.ts
โ”‚   โ”œโ”€โ”€ layouts/
โ”‚   โ”‚   โ””โ”€โ”€ Layout.astro
โ”‚   โ””โ”€โ”€ pages/
โ”‚       โ””โ”€โ”€ index.astro
โ”œโ”€โ”€ astro.config.mjs
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ tailwind.config.mjs
โ””โ”€โ”€ tsconfig.json

Key Files

  • astro.config.mjs โ€” Integrations (Tailwind, React, MDX), output mode, adapters, and Vite overrides.
  • src/content/config.ts โ€” Define content collection schemas with Zod. Astro auto-generates types for your content.
  • src/layouts/Layout.astro โ€” Base HTML shell with <slot /> for page content.
  • src/pages/index.astro โ€” File-based routing. .astro files render to static HTML at build time.

Extend With

ToolPurpose
React / Vue / SvelteInteractive islands with your preferred framework
MDXMarkdown with components for rich content
StarlightFull-featured documentation theme
Astro DBBuilt-in SQL database for content
View TransitionsSmooth page transitions without a SPA

References

  • Astro Documentation โ€” Complete guide to Astro features, integrations, and deployment
  • onwidget/astrowind (5.5k+ stars) โ€” Community template with Tailwind, MDX, blog, and landing page patterns