Skip to content

showIcons

  • Type: boolean | ((params: CallbackParams & { childOptions: ChildResolverOptions }) => boolean)
  • Optional: Yes

The showIcons property determines whether icons are displayed for items inside a list or document list. This corresponds to the .showIcons(showIcons) builder method in the Sanity Structure Builder API.

Standard Usage

ts
{
  title: 'All Content',
  showIcons: false,
  children: [
    {
      schemaType: 'post',
    },
    {
      schemaType: 'author',
    },
  ],
}
ts
helpers.children('All Content', [helpers.listing('post'), helpers.listing('author')], {
  showIcons: false,
});

Dynamic Icons Display (Callback)

You can dynamically show or hide icons based on the active desk context.

ts
{
  title: 'Articles',
  schemaType: 'article',
  // Only show icons on staging workspace for visual checks
  showIcons: ({ workspace }) => workspace === 'staging',
}
ts
helpers.listing('article', {
  title: 'Articles',
  showIcons: ({ workspace }) => workspace === 'staging',
});

Released under the MIT License.