How to view fields when creating a new document schema?
When you create a new document schema in Sanity, you'll see the fields for the first time by running your Studio locally and opening the editing interface. Here's the typical workflow:
Define Your Schema
First, create your schema using defineType in your schema files. For example:
import { defineType, defineField } from 'sanity'
export const product = defineType({
name: 'product',
type: 'document',
title: 'Product',
fields: [
defineField({
name: 'productName',
type: 'string',
title: 'Product name',
}),
// Additional fields...
],
})Register in sanity.config.js
Add your schema type to the sanity.config.js file:
import { defineConfig } from 'sanity'
import { deskTool } from 'sanity/desk'
import { product } from './schemas/product'
export default defineConfig({
// ... other config
schema: {
types: [product]
}
})Start the Development Server
Run the sanity dev command to start your local Studio:
npm run dev
# or
sanity devYour Studio will be available at http://localhost:3333 by default.
View Your Fields
Once the Studio loads, you'll see your new document type in the interface. Click on it to create a new document, and you'll see all your defined fields rendered in the Form View - the default editing interface that automatically generates form inputs based on your schema definition.
The Form View translates your schema into user-friendly input components, so each field type (string, number, image, etc.) appears with the appropriate input control. Any validation rules, descriptions, or customizations you've added to your schema will also be reflected in the interface.
Thanks to Vite-powered live reloading, any changes you make to your schema will automatically update in the browser without needing to restart the server!
Show original thread31 replies
Sanity – Build the way you think, not the way your CMS thinks
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.