BetaBetacommandThe 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 BetaconditionOptional 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
};
Use rules.visibility instead. When
both are set, action-menu surfaces evaluate rules.visibility and
ignore condition. Migrating an action to rules.visibility for
visibility requires the useRuleVisibility feature switch to be
enabled. While it is off, surfaces keep evaluating condition.
Optional BetadescriptionAdditional 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.
Optional BetadisabledControls 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:
Optional BetahideControls 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 BetaiconIcon to display with the action.
Can be either a string referencing an icon name from the platform's icon library, or an Icon object with additional properties like color.
Icons help users quickly identify actions and improve visual scannability of action menus and toolbars.
Optional BetalabelDisplay 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.
Optional BetarulesOptional behavior rules.
Optionalvisibility?: RuleRule that gates whether the action is visible.
rules.visibility only gates action visibility while the
useRuleVisibility feature switch is enabled. While it is off,
surfaces fall back to the legacy condition.
If both rules.visibility and the legacy condition are set
on the same action, action-menu surfaces evaluate
rules.visibility and ignore condition.
Hide a delete action unless the user is an admin and the deal is still open:
const deleteAction: LimeObjectAction = {
label: 'Delete',
command: new DeleteObjectCommand(),
rules: {
visibility: {
type: 'all',
rules: [
{
type: 'ref',
id: 'limetech.user-has-role',
args: { roles: ['admin'] },
},
{ type: 'ref', id: 'mycorp.deal-is-open' },
],
},
},
};
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