A Sanity + Next.js implementation of the Mast Framework, originally built for Webflow. This project brings Mast's powerful page-building system to the headless CMS world with real-time visual editing and AI-powered content creation.
Mast is a component-based design system and page builder framework that provides a structured, flexible approach to building websites. It uses a hierarchical Section → Row → Column → Content Block architecture that gives designers and developers precise control over layout and content.
- Sections - Top-level containers with background options, padding controls, and max-width settings
- Rows - Flexible layouts with horizontal/vertical alignment, gap controls, and wrap options
- Columns - Responsive width controls (12-column grid), with desktop/tablet/mobile breakpoints
- Content Blocks - Modular components including headings, rich text, images, buttons, sliders, tabs, accordions, and more
- Real-time Preview - Edit content in Sanity Studio and see changes instantly in the presentation view
- Custom Overlay Labels - Hover over any component to see its type (Section, Row, Column, Heading, etc.)
- Column Gutter Indicators - Visual SVG pattern showing column padding/gaps in edit mode
- Drag-and-Drop - Reorder sections, rows, and content blocks with Sanity's visual editing tools
- Breakpoint Controls - Set different column widths for desktop, tablet, and mobile
- Mobile-First - Columns stack vertically on mobile with optional reverse order
- Flexible Gaps - Configurable spacing between columns using a Bootstrap-style gutter system
- Heading Block
- Rich Text Block
- Eyebrow Block
- Image Block
- Button Block
- Spacer Block
- Divider Block
- Slider/Carousel Block
- Tabs Block
- Accordion Block
- Card Block
- Icon Block
- Modal Block
- Video Block
- Marquee Block
- Breadcrumb Block
- Table Block
- Blog Grid Block
A custom Sanity Studio plugin that provides AI-powered content creation and document operations:
- Real-time streaming responses from Claude API
- Document operations — create, update, and delete content via natural language
- Schema awareness — Claude understands your content structure
- Conversation persistence — chat history stored in Sanity
- Custom instructions — configure writing guidelines and brand voice
- Workflows — reusable prompt templates for common tasks
See the Claude Assistant Porting Guide for instructions on extracting this plugin for use in other projects.
- Frontend: Next.js 16 (App Router, Turbopack)
- CMS: Sanity Studio v6 with Presentation Tool (next-sanity 13)
- Styling: Tailwind CSS v4
- UI Components: Radix UI primitives
- Icons: Phosphor Icons, Lucide React
├── frontend/ # Next.js application
│ ├── app/
│ │ ├── components/
│ │ │ ├── blocks/ # Content block components
│ │ │ ├── overlays/ # Visual editing overlay components
│ │ │ └── ui/ # Reusable UI components
│ │ └── ...
│ └── sanity/ # Sanity client configuration
│
└── studio/ # Sanity Studio
└── src/
├── schemaTypes/ # Content schemas
└── structure/ # Studio structure configuration
- Node.js 22.12+ (required by Sanity Studio v6; Node 22 LTS recommended — Node 24 has been reported to segfault during
npm installon macOS) - A Sanity account (sanity.io)
- Clone the repository and install dependencies:
npm install- Create environment files:
.env (project root — used by seed scripts)
SANITY_STUDIO_PROJECT_ID="your-project-id"
SANITY_STUDIO_DATASET="production"
SANITY_API_TOKEN="your-write-token"
Create a token with Editor permissions at sanity.io/manage → your project → API → Tokens. The seed script reads
SANITY_STUDIO_PROJECT_ID(orNEXT_PUBLIC_SANITY_PROJECT_ID) to know which project to write to.
studio/.env
SANITY_STUDIO_PROJECT_ID="your-project-id"
SANITY_STUDIO_DATASET="production"
SANITY_STUDIO_PREVIEW_URL="http://localhost:3001"
frontend/.env.local
NEXT_PUBLIC_SANITY_PROJECT_ID="your-project-id"
NEXT_PUBLIC_SANITY_DATASET="production"
NEXT_PUBLIC_SANITY_API_VERSION="2025-09-25"
NEXT_PUBLIC_SANITY_STUDIO_URL="http://localhost:3334"
SANITY_API_READ_TOKEN="your-read-token"
ANTHROPIC_API_KEY="your-anthropic-key" # Optional — enables Claude assistant
- Seed starter content:
npm run seedThis single command populates your Sanity dataset with everything you need to get started:
| Category | What gets created |
|---|---|
| Singletons | Site Settings, Navigation (links + CTA), Footer (link columns + social links) |
| Pages | Home page (hero section) + Mast demo page (all block types) |
| Blog | 3 categories + 5 sample blog posts |
| People | 2 sample authors (Jane Doe, Alex Chen) |
| Section Templates | Hero Center, Features 3-Column, CTA Banner, FAQ Accordion |
| Content Variables | Brand Name, Support Email, Tagline |
| Claude AI Config | API Settings, Training/Instructions, 4 Quick Actions |
After seeding, open Sanity Studio and publish all documents so they appear on the frontend.
- Start the development servers:
npm run dev- Sanity Studio: http://localhost:3334
- Next.js Frontend: http://localhost:3001
npm run dev # Run both Studio and Next.js
npm run dev:studio # Run only Sanity Studio
npm run dev:next # Run only Next.js frontendnpm run lint # ESLint on the frontend
npm run type-check # TypeScript in both workspaces
npm run format # PrettierAfter changing any Sanity schema, regenerate the schema snapshot and typed query results and commit both generated files (studio/schema.json, frontend/sanity.types.ts) — CI fails if they're stale:
cd frontend && npm run typegen| Document | Description |
|---|---|
| Full Project Code Review | Comprehensive technical specification of the codebase |
| Claude Assistant Porting Guide | Extract the AI assistant plugin for other projects |
| CLAUDE.md | Project-specific context for Claude Code |
This project is configured to work with AI assistants like Claude Code. The .claude/ directory contains performance optimization skills (React and Sanity best practices) that provide context for high-quality code generation.
Contributions are welcome! See CONTRIBUTING.md for setup instructions and guidelines. To report a security issue, see SECURITY.md.
- Mast Framework by NoCode Supply
- Starter Template — Next.js + Sanity Clean by Sanity
- React Best Practices by @shuding at Vercel — vercel-labs/agent-skills
- Sanity Best Practices from sanity-io/agent-toolkit
- Built with Sanity and Next.js
This project is open source under the MIT License.