A production-ready Astro starter with Tailwind CSS 4, DaisyUI 5, blog support, SEO basics, and optional Alpine JS for tiny progressive enhancement.
Live Demo · Report a bug · Request a feature
pnpm create astro@latest --template aholbreich/astro-tailwind-daisyui-starterOr clone directly:
git clone https://github.com/aholbreich/astro-tailwind-daisyui-starter.git my-project
cd my-project
pnpm install
pnpm devThis repository is a production-ready Astro starter.
It is opinionated enough to be useful, but small enough to understand quickly. It offers strong defaults and a small number of focused escape hatches. It is meant to be friendly to both experienced developers and newcomers who want a clear starting point they can control.
It keeps the stack focused on purpose:
- Astro 6 for the site shell and content-first workflow
- Tailwind CSS 4 for styling
- DaisyUI 5 as the default UI layer
- Alpine JS only where a few lines of client-side behavior are useful
The goal is simple: start quickly, keep control, and ship without unnecessary setup friction.
- You want a clean Astro starter with strong defaults instead of a blank repo.
- You want DaisyUI included on purpose.
- You want blog/content support, sitemap, SEO basics, icons, dark mode, and accessibility basics already wired up.
- You want example pages and components that are easy to delete.
- You want something production-usable immediately without becoming a large scaffolding system.
- You want a theme, landing page kit, or large component gallery.
- You want a generator with many install-time choices.
- You want auth, database, API, CMS, or app-style state management included from the start.
- Astro 6
- Tailwind CSS 4 via
@tailwindcss/vite - DaisyUI 5 as the default UI layer
- Alpine JS for small enhancements only
- Typed blog content collection with Markdown and MDX support
- Tailwind Typography plugin for blog/article content
- SEO meta component, sitemap, and
robots.txt astro-iconwith local SVG icons- Inter configured through Astro 6's fonts API with a checked-in local variable font
- Dark mode toggle with no flash on first paint
- Accessibility basics including skip link and reduced-motion support
- Static output by default, adapter-free until you actually need one
- GitHub Actions CI for
astro checkand build
- A theme or page builder
- A large starter option matrix
- Authentication
- Database or API layer
- Analytics or tracking
- Multiple UI frameworks
- A heavy component library beyond DaisyUI
| Command | Action |
|---|---|
pnpm install |
Install dependencies |
pnpm dev |
Start the dev server on localhost:4321 |
pnpm check |
Run astro check |
pnpm build |
Build the production site |
pnpm preview |
Preview the production build locally |
pnpm astro ... |
Run Astro CLI commands |
pnpm release:minor |
Guarded local release flow for a minor version |
Astro 6 requires Node 22.12.0 or newer. The repository includes an .nvmrc
with that baseline.
Set your public site metadata in .env:
PUBLIC_SITE_URL=https://example.com
PUBLIC_TWITTER_HANDLE=@yourhandleAstro validates these values in astro.config.mjs, then the starter reuses
them in src/site-config.ts for sitemap, canonical URLs, and social metadata.
This starter is meant to be understandable at a glance:
- One site config file:
src/site-config.ts - One base layout:
src/layouts/Layout.astro - A small set of components you can keep or delete
- A minimal blog collection in
src/content/blog/ - A single DaisyUI reference page you can keep, adapt, or delete
/
├── .github/
│ ├── ISSUE_TEMPLATE/
│ └── workflows/
├── public/
├── scripts/
│ └── release.mjs
├── src/
│ ├── components/
│ ├── content/
│ │ └── blog/
│ ├── icons/
│ ├── layouts/
│ ├── pages/
│ ├── styles/
│ ├── content.config.ts
│ └── site-config.ts
├── astro.config.mjs
├── package.json
└── tsconfig.json
Update the site title, description, navigation, footer text, and social metadata.
The production URL and default Twitter handle come from validated public env
vars so they stay aligned with Astro's site config.
Adjust DaisyUI and theme tokens. If you want to move away from DaisyUI later, this is one of the main files you will touch.
The starter uses Astro 6's fonts API end to end:
astro.config.mjsregisters the local Inter variable font and exposes--font-intersrc/layouts/Layout.astroloads it with<Font cssVariable="--font-inter" />src/styles/fonts.cssmaps that variable to Tailwind's--font-sans
That means Tailwind utilities and DaisyUI components both inherit the same font without extra component-level setup.
This separation is intentional:
- Astro handles font sourcing, optimization, and the CSS variable
- Tailwind uses that variable as the shared sans-serif token
- DaisyUI inherits the Tailwind font token through the normal component styles
Update the HTML shell, view transitions, metadata defaults, and theme bootstrapping.
Set the final site URL. Add a deployment adapter only if your target platform
or runtime needs one.
Posts live in src/content/blog/. The included sample posts are meant to show
real Markdown/MDX usage, including images, video embeds, and code blocks.
Add a post like this:
---
title: My first post
description: A short summary shown in listings and meta tags.
pubDate: 2024-06-01
draft: false
---
Your content here.The starter builds as a plain static Astro site by default.
That keeps the template portable and easier to understand. If you later need platform-specific SSR, image services, edge runtime support, or other adapter features, add the relevant adapter for your deployment target at that point.
Set site in astro.config.mjs to your production URL so sitemap and canonical URLs are correct.
See CONTRIBUTING.md.
This repository uses semver.
pnpm release:patch
pnpm release:minor
pnpm release:major
git push && git push --tagsThe local release script checks that:
- you are on
main - the working tree is clean
CHANGELOG.mdstill has anUnreleasedsectionpnpm checkpassespnpm buildpasses
It then asks for confirmation and runs pnpm version for you. The pushed tag triggers the GitHub release workflow.