DEV Community

Alex Spinov
Alex Spinov

Posted on

Prismic Has a Free Headless CMS — Slice-Based Content Modeling for Modern Websites

Prismic Has a Free Headless CMS — Slice-Based Content Modeling for Modern Websites

Building a marketing site? Product pages? A blog? Prismic's "Slice Machine" lets you build pages from reusable content slices — like Lego blocks for your website content.

Prismic is a headless CMS with a unique approach: instead of traditional content types, you build pages from Slices — modular, reusable content sections that editors can mix and match.

Free Tier (Community Plan)

  • Unlimited documents
  • 1 user
  • 1 custom type
  • Unlimited API calls
  • Built-in CDN
  • Slice Machine (visual slice builder)

What Are Slices?

Think of a landing page as a stack of sections: hero → features → testimonials → pricing → CTA. Each section is a "Slice" with its own fields and layout.

// Define a Hero slice
const HeroSlice = {
  type: 'hero',
  fields: {
    title: { type: 'StructuredText' },
    subtitle: { type: 'StructuredText' },
    backgroundImage: { type: 'Image' },
    ctaText: { type: 'Text' },
    ctaLink: { type: 'Link' }
  }
};

// Editors drag and drop slices to build pages
// Developers define how each slice renders
Enter fullscreen mode Exit fullscreen mode

Fetching Content

import * as prismic from '@prismicio/client';

const client = prismic.createClient('your-repo-name');

// Get a page by UID
const page = await client.getByUID('page', 'homepage');

// Access slices
page.data.slices.forEach(slice => {
  switch (slice.slice_type) {
    case 'hero':
      console.log(slice.primary.title[0].text);
      break;
    case 'features':
      slice.items.forEach(item => {
        console.log(item.feature_title[0].text);
      });
      break;
  }
});

// Query with predicates
const posts = await client.getAllByType('blog_post', {
  orderings: [{ field: 'document.first_publication_date', direction: 'desc' }],
  pageSize: 10
});
Enter fullscreen mode Exit fullscreen mode

Next.js Integration

import { SliceZone } from '@prismicio/react';
import { components } from '../slices';

export default function Page({ page }) {
  return <SliceZone slices={page.data.slices} components={components} />;
}

export async function getStaticProps({ params }) {
  const client = prismic.createClient('your-repo');
  const page = await client.getByUID('page', params.uid);
  return { props: { page }, revalidate: 60 };
}
Enter fullscreen mode Exit fullscreen mode

The Bottom Line

Prismic's Slice Machine makes it easy to build component-driven websites where marketers can create pages without developer help. The free tier is generous for small projects.


Need to extract content from CMS platforms, migrate between systems, or monitor competitor pages? I build custom data tools.

📧 Email me: spinov001@gmail.com
🔧 My tools: Apify Store

Top comments (0)