Brought to you by the Prismic Solution Engineering Team.
A Next.js (App Router) + Prismic demo built with the current Prismic setup — a single prismic.config.json, the @prismicio/client / @prismicio/react / @prismicio/next packages, and the prismic CLI. There is no Slice Machine UI: you model content in the web Page Builder and sync it to code with the CLI.
Prerequisite: Node.js 20 or above — https://nodejs.org
cd slicify-v4-demo-template
npm installnpm run devYour site runs at http://localhost:3000. (dev first runs a quick slice-usage analysis; use npm run dev:no-analysis to skip it.)
Open your repository and use the Page Builder to create and edit page types, custom types, slices, and documents:
https://slicify-v4-template.prismic.io
This replaces the old local Slice Machine app.
Local models live in ./customtypes (types) and ./slices (slices). The prismic CLI keeps them in sync with the repository — local is the source of truth for push:
npx prismic push # push local types & slices to Prismic
npx prismic pull # pull types & slices from Prismic into your code
npx prismic status # show local vs remote differences
npx prismic gen types # regenerate prismicio-types.d.ts from local modelsprismic.config.json # repositoryName + slice libraries + route resolver
prismicio.ts # Prismic client (routes, auto-previews, caching)
prismicio-types.d.ts # generated TypeScript types
customtypes/ # custom types & page types
slices/ # slice models + React components (marketing, blog)
app/
[lang]/ # localized routing (home, blog, blog article, landing, search)
lp/[uid]/ # landing pages by UID
blog/[...articleSlug]/
api/preview # preview session handler
api/exit-preview
api/revalidate # on-publish cache revalidation webhook
slice-simulator/ # slice preview endpoint
slice-library/ # internal slice catalog (dev tool)
slice-usage/ # where each slice is used (dev tool)
Both work out of the box (standard prismic init scaffolding):
- Page previews —
<PrismicPreview>(inapp/layout.tsx) +enableAutoPreviews(inprismicio.ts) + the/api/previewroute. In the Page Builder, go to Settings → Previews and add a preview with your site's Domain and the route/api/preview(e.g.http://localhost:3000for local). You do not need to paste the Prismic Toolbar<script>—<PrismicPreview>injects it. - Slice Simulator — served at
/slice-simulator. In the Page Builder, set the Slice Simulator URL tohttp://localhost:3000/slice-simulatorto get the live editing experience while editing slices.
Prismic Environments are cloned repositories for safely testing model/content changes before production. No extra code is required — enableAutoPreviews reads the preview cookie and automatically serves content from whichever environment you preview from. Configure each environment's own Previews and Slice Simulator URL (usually pointed at http://localhost:3000) in that environment's settings. Keep prismic.config.json pointed at your production repository.
On a live deployment, published content updates propagate via the revalidation webhook: production fetches are cached (force-cache, tag prismic), and /api/revalidate calls revalidateTag("prismic"). In the repository's Settings → Webhooks, add https://<your-domain>/api/revalidate triggered on publish/unpublish.
Prismic + Next.js documentation: https://prismic.io/docs/nextjs
This project is made to test out Prismic. Slices used in this project are subject to the Tailwind UI license: https://tailwindui.com/license Images used in this project are from unsplash.com; see the Unsplash license: https://unsplash.com/license
This is a Next.js project. To learn more:
- Next.js Documentation — features and API.
- Prismic + Next.js — modelling and querying content.