Skip to content
Sanity
Get started
  • Sanity Studio - Flexible editing environment
  • Content Lake - Real-time database
  • Developer experience - Tooling you love
  • Structured content - The philosophy behind Sanity
  • Review changes - View edits & rollback instantly
  • Image pipeline - On-demand transformations
  • E-commerce - Better shopping experiences
  • Marketing sites - Control your story
  • Products & services - Innovate and automate
  • Mobile apps - Content backend for every OS
  • Aether - Unique digital shopping experience
  • Morning Brew - Omnichannel media distribution
  • InVision - Delivering exceptional customer experiences
  • DataStax - Personalization for global audience
  • React
  • Gatsby
  • Next
  • Nuxt
  • Eleventy
  • Netlify
  • Vercel
  • Algolia
  • Documentation
  • Reference
  • Guides
  • Resource library
  • Headless CMS
  • Tools & plugins
  • Project showcase
  • Schemas & snippets
  • Agency partners
  • Technology partners
  • Get support
  • Share your work
  • 5 Disadvantages Of Wordpress That Are Holding You Back
EnterprisePricing
Contact salesLog inGet started
Published September 28th 2018

Structure Sanity Studio to Your Heart’s Content!

We have launched structure builder for Sanity Studio. Now you can customize how content types and documents should be listed out.

Even Eidsten Westvang

Even is a Sanity.io co-founder and product person

One of the most frequent feature requests we have had since launch is the capability to just have one of a certain document type. Think some global configuration or meta-info. It has been called “singletons” by some. It has been technically possible the whole time, but there hasn’t been an easy and obvious way to display it in Sanity Studio’s Desk Tool, our open source content editor. Until now.

With the recent release (sanity upgrade) we introduce the new structure builder, which gives you full control over how documents are listed out in the Desk Tool. But its capabilities go far beyond just adding support for singletons: It makes it possible to filter, group, and list out documents in hierarchies.

Because the structure builder just configures the view, you don’t have to change your existing content model to use it, which means that you can display the same documents in different ways, at the same time. The structure supports promises and observables, which also makes it possible to tie how documents are laid out to external APIs, even in real-time. It’s powerful stuff!

As with most of what we make for Sanity Studio, structure builder is mostly just JavaScript (the package it’s actually implemented in TypeScript, which adds some nice autocomplete features in code editors that supports it). You can get up and running in a couple of minutes by reading the introduction in the documentation.

import S from '@sanity/desk-tool/structure-builder'

const hiddenDocTypes = listItem => !["config"].includes(listItem.getId())

export default () =>
S.list()
  .title('Content')
  .items([
    S.documentListItem()
      .id('global-config')
      .title('Configuration')
      .schemaType('config'),
    ...S.documentTypeListItems()
      .filter(hiddenDocTypes)
  ])
Example of global configuration in the Ecommerce example project

We believe the new Structure Builder sets Sanity even more apart when it comes to giving you full flexibility for your content authoring needs. We will continue to improve its capabilities and can’t wait to get your feedback in our community Slack and to see what you’ll make with it.

Platform

Structured ContentDeveloper experienceContent LakeSanity StudioSecurity & Compliance
  • Sanity vs Contentful
  • Sanity vs Strapi
  • Sanity vs Wordpress
  • Sanity vs Adobe Experience Manager
  • Sanity vs Hygraph
  • Sanity vs Sitecore
  • Sanity vs Storyblok
  • Sanity vs Contentstack
  • Sanity vs Prismic
  • Sanity vs Drupal
  • Sanity vs ButterCMS

Resources

Documentation
  • React Blog
  • Gatsby Blog
  • Next.js Landing Pages
  • Progressive Web Application
  • Single Page Application
  • Svelte & Typescript App
  • Vue & Tailwind Blog
  • Developer Portfolio Templates
  • Form validation with Yup
  • Live Preview with Next.js and Sanity.io
Resource library
  • Agency partners
  • Technology partners
  • Blog Template
  • Personal Website Template
  • Developer Portfolio Templates
  • All Templates
Case Studies
  • Headless CMS
  • What is an API CMS
  • Static Sites 101
  • Headless SEO
  • Localization
  • GraphQL vs REST
  • What is a DXP?
  • Typescript 101
  • Content as a Service
  • Ecommerce SEO
  • React CMS
  • Next.JS CMS
  • CMS for Shopify
  • Content platform
  • Multilingual CMS
  • Static Site CMS
  • Gatsby CMS
  • Node CMS
  • E-commerce CMS
  • Vue CMS
  • Angular CMS
  • GraphQL CMS
  • Newspaper CMS
  • Magazine CMS
  • CMS for apps
  • Remix CMS

Company

Contact SalesEnterpriseCareersTerms of ServiceAccessibility Statement

Stay connected

  • GitHub
  • Slack
  • Twitter
  • YouTube
  • Stack Overflow
  • Blog RSS
  • Newsletter
©Sanity 2023