Turbo Confirm

Turbo Confirm component for confirmation modals.

Usage

# <% Add the component once in your layout %>
<%= ui.turbo_confirm %>

# <% Then use data-turbo-confirm on any button or link %>
<%= ui.btn "Delete", variant: :danger, url: "/items/1", method: :delete, data: { turbo_confirm: "This action cannot be undone." } %>

# <% Or with a regular link %>
<%= link_to "Remove", item_path(@item), method: :delete, data: { turbo_confirm: "Are you sure?" } %>

Examples

Basic confirmation

<%= ui.btn "Delete", variant: :danger, url: "#", method: :delete, data: { turbo_confirm: "Blocking this account will prevent further interactions, and you have the option to unblock it later if needed." } %>