
Template details
Astro Theme Provider
Author themes for Astro like a normal project and export your work as an integration for others to use.
About this template
Astro Theme Provider is a developer tool for the Astro framework that turns a standard Astro project into a reusable theme integration for other developers.
What is Astro Theme Provider?
Astro Theme Provider takes a normal Astro project—complete with public, src/assets, components, layouts, pages, and styles—and lets the author wrap it with a Zod schema via defineTheme, producing an integration that consumers can install in astro.config.mjs. The tool is currently in Beta and is maintained by the Astrolicious community. It publishes documentation at astro-theme-provider.netlify.app and provides a starter theme template at GitHub.
Key Features
- Standard project authoring — Themes are built exactly like any Astro project using Astro's own components, layouts, pages, and styles, rather than a special theme format.
- Zod schema configuration — Theme authors define a schema with
z.objectfromastro/zod, and consumers pass validated config through the integration'sconfigoption. - Route control — Consumers can toggle routes off (for example setting the
/404route tofalse) or overwrite a route to a custom path (mapping/blogto/projects). - Component overrides — Users can replace theme components with their own Astro components via the
overrides.componentsproperty, such as mappingHeroto a localCustom.astrofile. - Custom stylesheets — Users can add extra CSS files through
overrides.styles, an array of local stylesheet paths. - Beta status — The package is marked Beta on npm, with an active contributing guide, Discord channel, and discussion forum in the repository.
Who is it for?
- Astro theme developers — For building a distributable theme once and letting any Astro project install it as an integration.
- Agencies and freelancers — For reusing a design system across multiple client Astro projects with per-project config and overrides.
- Open-source maintainers — For publishing a blog or portfolio theme that others can configure without editing the theme's source code.
What can you do with it?
- Theme authors: Author a theme as a normal Astro project, declare its configurable options with Zod, and publish the integration to npm.
- Site builders: Install a published theme and customize it with config values, route overwrites, component swaps, and additional stylesheets.
- Teams with multiple sites: Keep a consistent theme while allowing each site to override specific components and routes.
How does it work?
- Build the theme as a normal Astro project with a package folder containing
public,src, and anindex.tsentry point. - In
index.ts, importdefineThemefromastro-theme-providerand export the result ofdefineThemewith a Zod schema for configuration. - Consumers install the published package and add it to the
integrationsarray inastro.config.mjs, passingconfig,pages, andoverrides.
FAQ
Is Astro Theme Provider production-ready?
The package is in Beta, as shown on its npm badge. The API may change while the maintainers stabilize the design.
How do I override a theme component?
Use the overrides.components option, for example mapping the theme's Hero component to a local ./src/Custom.astro file. That replaces every instance of that component with your own.
Can I disable a page that the theme provides?
Yes, set the route to false in the pages option, such as pages: { '/404': false }, which turns that route off for the site.
Where is the documentation?
The documentation is hosted at astro-theme-provider.netlify.app, and there is a theme template at github.com/astrolicious/astro-theme-provider-template.
















