Beta The command to execute when the action is activated.
This command will be dispatched to the CommandBus when the user triggers the action. The command type determines what operation will be performed (e.g., save, delete, export, send email).
Optional conditionOptional condition that determines whether the action is available.
If provided, the condition's evaluate function will be called to determine
if the action should be shown or enabled. If the condition evaluates to
false, the action is typically hidden from the UI.
This is particularly useful for:
const canDelete: LimeObjectCondition = {
id: 'record.can-delete',
type: 'limeobject',
evaluate: (obj) => !obj.locked
};
const deleteAction: LimeObjectAction = {
label: 'Delete',
command: new DeleteObjectCommand(),
condition: canDelete
};
Optional descriptionAdditional descriptive text explaining what the action does.
Descriptions provide more context than labels alone and are typically displayed in:
Use descriptions to clarify the action's purpose or any side effects.
{
label: 'Export to Excel',
description: 'Download all selected records as an Excel spreadsheet',
command: { name: 'export-excel' }
}
Optional disabledControls whether the action is disabled (grayed out but visible).
When true, the action is shown in the UI but cannot be triggered.
This is different from hiding the action entirely (using condition).
Use disabled state to:
{
label: 'Save',
icon: 'save',
command: new SaveCommand(),
disabled: !this.hasUnsavedChanges
}
Optional hideControls whether the action's label should be hidden in the UI.
When true, only the icon is displayed, creating a more compact interface.
However, the label should still be provided for:
Icon-only actions work best in toolbars where space is limited and icons are easily recognizable.
Optional iconOptional labelDisplay label for the action.
This text is shown to the user in menus, buttons, or tooltips. The label is automatically translated using the platform's Translator service, so you should provide translation keys rather than hardcoded strings.
Even if hideLabel is true, you should still provide a label for
accessibility and alternative display contexts.
Represents a user-triggerable action that can be displayed in various UI contexts.
Actions are the primary way to expose functionality to users through the UI. They can appear as:
Each action wraps a command that executes when the action is triggered. Actions can be conditionally shown or hidden using Conditions, and they support rich metadata like icons, labels, and descriptions for better UX.
The generic type parameter
Tallows you to specify the exact command type, enabling type-safe action definitions for specific contexts like single objects or bulk operations.Example
Basic action with icon and label
Example
Conditional action with icon-only display
Example
Action with description and disabled state
See