Skip to Content
tansy
Themes

Themes

A theme is a package that renders your site's pages from the CMS's content, with no code in your app beyond one route.

A theme turns content into a site. It is a package you name in tansy.config.ts, and it renders the pages for the collections' URL patterns: lists, single records, search, and whatever else it declares. Your app keeps one route for the site, and the theme does the rest.

tansy.config.ts
import { defineCms } from "tansy/config";
import { magazine } from "@tansy/theme-magazine";

export default defineCms({ theme: magazine() });

The same theme package renders a headless front end over the API, so a site on its own domain or its own deployment needs no second implementation.

The themes that ship

@tansy/theme-blank is a starting point with no opinions, and @tansy/theme-blog a small worked example. Both are in the repository under themes/.

Writing your own

On this page