Skip to content

isVisible

  • Type: boolean | ((params: CallbackParams) => boolean)
  • Optional: Yes (Default: true)

The isVisible property controls whether the list item is visible in the Sanity desk navigation menu.

Standard Usage

Set isVisible: false to hide a list item from the navigation pane completely.

ts
{
  schemaType: 'author',
  isVisible: false,
}
ts
helpers.listing('author', {
  isVisible: false,
});

Dynamic Visibility (Callback)

You can set isVisible dynamically using a callback function based on the active desk context. This is useful for showing/hiding items depending on the active workspace or current user roles.

ts
{
  schemaType: 'settings',
  singleton: true,
  isVisible: ({ currentUser }) => currentUser.roles.some((role) => role.name === 'administrator'),
}
ts
helpers.singleton('settings', {
  isVisible: ({ currentUser }) => currentUser.roles.some((role) => role.name === 'administrator'),
});

Released under the MIT License.