Skip to content

List Items

The core of Sanity Structure Tool is the ListItem configuration. This guide provides a complete index of all configuration properties.

Using Helpers

You can define list items using either raw objects or the built-in Helpers. Helpers provide enhanced type intelligence and a more expressive syntax.

Dynamic Values (Callbacks)

Almost every property on a ListItem supports dynamic values. Instead of passing a static value, you can pass a callback function that receives the active desk context:

ts
({ workspace, currentUser, context }) => value;

This dynamic callback pattern allows you to compute structure values dynamically based on the current workspace, logged-in user, or Sanity context.

Callback Parameters

ParameterTypeDescription
workspacestringThe active workspace name.
currentUserCurrentUserThe currently logged-in Sanity user.
contextConfigContextThe raw Sanity config context.
childOptionsChildResolverOptionsOptional. Resolver options from the active child pane structure resolution context (Sanity Studio).

Resolver-level Callback Parameters

The childOptions parameter is passed to callback properties that resolve recursively down a structural path (e.g. children, showIcons, filter, componentOptions, menuItems, etc.). This enables access to current route parameters, parent structure references, or payload values.

Example

ts
helpers.listing('author', {
  // Compute title dynamically based on workspace
  title: ({ workspace }) => (workspace === 'staging' ? 'Review Authors' : 'Authors'),
  // Hide add button dynamically for non-admin users
  hideAddButton: ({ currentUser }) =>
    !currentUser.roles.some((role) => role.name === 'administrator'),
});

Property Reference

Click on any property name below to view its complete type definition, details, and interactive usage examples (Standard JSON vs Helpers).

PropertyOptionalDescription
apiVersionYesSpecifies the Sanity API version to use for this specific list item.
childrenYesAn array of ListItem objects to create a nested list.
componentYesRenders a custom React component as the view for a list item.
componentOptionsYesPasses custom options or properties to your custom component.
defaultLayoutYesSpecifies the default layout style for documents listed.
defaultOrderingYesSets the default sorting order for document lists.
defaultPanesYesDefines which view pane tabs are active/open side-by-side by default.
filterYesA GROQ filter string to limit which documents are shown.
filterParamsYesParameters to be used within the filter GROQ string.
hideAddButtonYesHides the "Add" button (plus icon) for the document list.
iconYesThe icon to display to the left of the title.
idYesUniquely identifies the list item in the desk menu path.
isDividerYesRenders as a visual separator in the desk list.
isPluralYesControls automatic pluralization of the auto-generated title.
isVisibleYes (Default: true)Controls the visibility of the list item in the navigation menu.
menuItemGroupsYesGroups custom actions/items in the pane header menu.
menuItemsYesDefines custom actions/items in the pane header menu.
rawYesThe "Escape Hatch" to use the native Sanity Structure Builder API.
rolesYesRestricts the visibility of the list item to specific user roles.
schemaTypeYesThe name of the document type defined in your Sanity schema.
showIconsYesControls whether icons are displayed for items inside this list.
singletonYesTreats the item as a single document rather than a list.
templatesYesPasses initial value templates for new documents.
titleYesThe display name for the list item in the Sanity desk menu.
viewsYesDefines multiple pane tabs (views) for singletons or document editors.
workspacesYesRestricts the visibility of the list item to specific workspaces.

Released under the MIT License.