Are you an LLM? You can read better optimized documentation at /examples/hide-add-button.md for this page in Markdown format
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'),
});