You can trigger the opening and closing of action cards (modals) using specific HTML data attributes. This allows you to manage UI actions without writing custom JavaScript for every button.
Open an Action Card
Add the data-p-open-actions attribute to a button or element. The value of this attribute must be a valid CSS selector (e.g., an ID or class) for the action card you wish to display.
Close an Action Card
Add the data-p-cancel-action attribute to a button or element to trigger the closing of the currently active action card.
Close on Outside Click
To allow a user to close an action card by clicking the background overlay, add the attribute data-p-close-on-outside="true" to the action card container (which should have the class .p-action-big-container).
<!-- Triggering an action card with ID 'my-action-card' -->
<button data-p-open-actions="#my-action-card">Open Actions</button>
<!-- The action card itself -->
<div id="my-action-card" class="p-action-big-container" data-p-close-on-outside="true" aria-hidden="true">
<p>Action Content</p>
<!-- Button to close the card -->
<button data-p-cancel-action>Cancel</button>
</div>
<!-- The background overlay (required for the manager to work) -->
<div class="p-action-background"></div>