An opinionated and minimally styled starter template with Tailwind CSS and pre-built schema and modules for rapid website development.
🖋️ Published on Sanity.io
⚡ Perfect Lighthouse scores on desktop and 99/100 on mobile.
🚀 Checkout the demo site, playground and docs page.
- Key Features
- Getting Started
- Time-based revalidation
- Visual Editing
- Staging
- Helpful Resources (The SanityPress Blog)
- External References
- Modern Frontend Development with Next.js (App Router, RSC, Typescript) and Tailwind CSS.
- Pre-configured Sanity schema for rapid content structuring.
- Pre-built frontend components for rapid website development.
- Visual editing in Presentation mode inside the Sanity Studio.
- Auto-generated sitemap.xml and blog rss.xml.
1. Start a new repo with the GitHub template
npm -y create sanity@latest
Note
The CLI will ask to create new a directory with the Sanity files, but you can remove once the project ID is retrieved.
# /next/.env.local
NEXT_PUBLIC_SANITY_PROJECT_ID = ...
NEXT_PUBLIC_SANITY_TOKEN = ... # retrieve from https://sanity.io/manage
NEXT_PUBLIC_REVALIDATE = ... # number in seconds; leave empty for `revalidate: false`
# /sanity/.env.local
SANITY_STUDIO_PROJECT_ID = ...
SANITY_STUDIO_PREVIEW_URL = ... # your live or staging site URL
- Site settings (sanity/schemas/documents/site.ts)
- Pages (sanity/schemas/documents/page.ts)
- Blog posts (sanity/schemas/documents/blog.post.ts)
Important
Required: Add a page with the slug index
for the Homepage
Optional: Add a page with the slug 404
for the 404 page
Update the Root Directory (Vercel) / Project Directory (Netlify) to next
. This is required to deploy the Next.js frontend.
Set up the Sanity Dashboard with your deployment service:
# Vercel — https://www.sanity.io/plugins/vercel-dashboard-widget
npm i sanity-plugin-dashboard-widget-vercel
# Netlify — https://www.sanity.io/plugins/sanity-plugin-dashboard-widget-netlify
npm i sanity-plugin-dashboard-widget-netlify
Feel free to adjust styles, add more schema and modules, and more.
Set NEXT_PUBLIC_REVALIDATE
(optional) environment variable to allow time-based revalidation for published Sanity documents.
Leave blank to disable revalidation ({ next: { revalidate: false } }
).
# /next/.env.local
NEXT_PUBLIC_REVALIDATE = 3600 # every hour
When empty (revalidate: false
), published Sanity documents will only be pushed to the live site when a new deployment is triggered.
Note
Currently only works on the local development environment of the Sanity Studio.
Content can be edited and previewed live from the Sanity Presentation mode by navigating to the Editor tab in the Studio.
Create a new git branch (call it anything—e.g. staging
or preview
) and set an environment variable specific to that branch in your deployment service (Vercel or Netlify):
# Environment variable for the staging branch (in Vercel, Netlify, etc.)
ENABLE_PREVIEW = true
Now you can use the preview deployment URL to share staged content (unpublished changes) with your team or clients.