Skip to content

hideAddButton

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

The hideAddButton property removes the "Add" (plus) icon from the document list.

Standard Usage

ts
{
  schemaType: 'author',
  hideAddButton: true,
}
ts
helpers.listing('author', {
  hideAddButton: true,
});

Dynamic Hide Add Button (Callback)

You can define hideAddButton dynamically using a callback function:

ts
{
  schemaType: 'author',
  hideAddButton: ({ currentUser }) => !currentUser.roles.some((role) => role.name === 'administrator'),
}
ts
helpers.listing('author', {
  hideAddButton: ({ currentUser }) =>
    !currentUser.roles.some((role) => role.name === 'administrator'),
});

Released under the MIT License.