Const
Options for the structure tool. See StructureToolOptions
// sanity.config.ts
import { defineConfig } from 'sanity'
import { structureTool } from 'sanity/structure'
export default defineConfig((
// ...
plugins: [
structureTool() // use defaults
]
})
// sanity.config.ts
import { defineConfig } from 'sanity'
import { structureTool } from 'sanity/structure'
import { FaCar } from 'react-icons'
export default defineConfig((
// ...
plugins: [
structureTool({
name: 'cars',
title: 'Cars',
icon: FaCar,
structure: (S) => S.documentTypeList('car'),
defaultDocumentNode: (S) =>
S.document().views([
S.view.form(),
S.view.component(Preview).title('Preview')
])
})
]
})
The structureTool is a studio plugin which adds the “structure tool” – a tool within Sanity Studio in which content editors can drill down to specific documents to edit them. You can configure your Studio's structure tool(s).