
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThis is a great question and honestly, there's no "perfect" solution â it's one of those things that evolves with your project! Your current approach is actually pretty solid and commonly used.
Here are a few patterns I've seen work well in Sanity + React/Next.js projects:
Your current approach (domain-based grouping):
components/
Blog/
index.js
BlogDetail.jsx
BlogOverview.jsx
BlogCard.jsxThis is totally valid! The index.js barrel export keeps imports clean. Some folks take this further by adding a Blog.module.css or co-locating tests here too.
Feature-based structure:
components/
blog/
BlogCard.jsx
BlogDetail.jsx
shared/
Button.jsx
Card.jsx
layout/
Header.jsx
Footer.jsxThis groups by feature/domain but flattens it a bit. Works well when components don't have many sub-components.
Atomic design approach:
components/ atoms/ # Button, Input, etc. molecules/ # BlogCard, SearchBar organisms/ # BlogOverview, Header templates/ # PageLayout
This can feel over-engineered for smaller projects, but scales nicely for design systems.
Sanity-specific consideration:
If you're using Portable Text for rich text, many folks create a dedicated structure:
components/
portableText/
serializers/
ImageSerializer.jsx
CodeSerializer.jsx
PortableTextRenderer.jsxMy personal take: Your current structure is fine! The main thing is consistency. I'd maybe add:
shared/ or common/ folder for truly reusable components (buttons, inputs, etc.)index.js) sparingly â they can hurt tree-shakingThe "never happy about the outcome" feeling is universal đ â just pick a convention, document it in a README, and stick with it. You can always refactor later when pain points become obvious!
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store