open-vault/ui/lib/core/stories/message.md

1.7 KiB

Message

Message components trigger and display a confirmation message. They should only be used within a Confirm component.

Properties

Param Type Default Description
id ID A unique identifier used to bind a trigger to a confirmation message.
onConfirm Func The action to take when the user clicks the confirm button.
[triggerText] String 'Delete' The text on the trigger button.
[title] String 'Delete this?' The header text to display in the confirmation message.
[message] String 'You will not be able to recover it later.' The message to display above the confirm and cancel buttons.
[confirmButtonText] String 'Delete' The text to display on the confirm button.
[cancelButtonText] String 'Cancel' The text to display on the cancel button.

Example

<div class="box">
  <Confirm as |c|>
    <c.Message
      @id={{item.id}}
      @triggerText="Delete"
      @message="This will permanently delete this secret and all its versions."
      @onConfirm={{action "delete" item "secret"}}
      />
  </Confirm>
</div>

See