
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeWelcome to the community! Great question - diving into an existing Sanity project without access to the original developer is definitely doable. Let me help you get oriented and solve your specific issue with adding a new block type.
Here's a practical roadmap for exploring an unfamiliar Sanity project:
1. Start with sanity.config.ts/js - This is your project's main configuration file at the root. It tells you:
2. Find the schema files - Look for a schemas or schemaTypes folder. This is your blueprint:
defineType or defineField)index.ts/js that usually imports and combines all schema types3. Identify the field you're working with - Since you're looking at a dropdown in a rich text editor, search your schemas for fields with type: 'array' that contain {type: 'block'} - this is Portable Text.
4. Check the Studio structure - Look at how content types are organized in the Studio UI to understand the project's content model.
Based on your screenshot showing a dropdown in the Portable Text editor, here's exactly how to add a new block type:
Create a new file in your schemas folder (or add to an existing one):
import {defineType, defineField} from 'sanity'
export const myCustomBlock = defineType({
name: 'myCustomBlock',
type: 'object',
title: 'My Custom Block',
fields: [
defineField({
name: 'content',
type: 'string',
title: 'Content',
}),
// Add whatever fields you need
]
})Add your new block type to your schema index file where all types are exported (usually schemas/index.ts).
Find the schema file that contains the field with that dropdown (likely the main content field for a document type). Look for something like this:
defineField({
name: 'body', // or 'content', etc.
type: 'array',
of: [
{type: 'block'}, // This is the standard text
{type: 'image'}, // Existing custom blocks
{type: 'myCustomBlock'}, // Add your new block here!
]
})Once you save and restart your Studio (if running locally with sanity dev), your new block type should appear in that dropdown!
Looking at your dropdown, I need to clarify something important:
If you're trying to add a text style (like a new heading level), you'd configure it differently:
defineField({
name: 'body',
type: 'array',
of: [
{
type: 'block',
styles: [
{title: 'Normal', value: 'normal'},
{title: 'Heading 2', value: 'h2'},
{title: 'My Custom Style', value: 'myStyle'}, // Add here
]
}
]
})If you share more details about what kind of block you're trying to add (is it for inserting custom content, or formatting text?), I can give you more specific guidance!
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