Destructive panel
A guarded destructive action: heading and consequences in plain language, a severity-tinted alert with the blast radius, and a cancel/confirm action pair.
Installation
Blocks are copied source, not library calls — the generator writes this
exact template into app/views/blocks/
and from there it's yours to edit. The preview below renders the same
source the copy-in produces.
bin/rails g poetry:block destructive-panel
Default
Revoke deploy token
The token stops working immediately. Three services signed their last deploy with it — their next runs will fail until a replacement is configured.
<%# Page framing: the panel keeps its container + breathing room when it
is the page's subject (a judged-run lesson); drop the outer wrapper
when composing into an already-padded frame. %>
<div class="mx-auto max-w-xl p-6">
<section class="space-y-4 rounded-lg border border-destructive/50 p-6" aria-labelledby="destructive-panel-title">
<div class="space-y-1">
<h2 id="destructive-panel-title" class="text-base font-semibold">Revoke deploy token</h2>
<p class="text-sm text-muted-foreground">The token stops working immediately. Three services signed their last deploy with it — their next runs will fail until a replacement is configured.</p>
</div>
<%# Icon + title only: an alert DESCRIPTION rides the destructive tint,
which sits at 4.49:1 on white (the standing token-retune ledger) -
the blast radius lives in the AA-clean muted copy above instead. %>
<%= poetry_alert(variant: :destructive) do |alert| %>
<% alert.with_icon(name: "triangle-alert") %>
<% alert.with_title { "This cannot be undone" } %>
<% end %>
<div class="flex items-center justify-end gap-2">
<%= poetry_button(variant: :outline) { "Cancel" } %>
<%= poetry_button(variant: :destructive) do |button| %>
<% button.with_leading { poetry_icon(name: :trash) } %>
Revoke token
<% end %>
</div>
</section>
</div>
Styling
A block has no styling surface of its own — every element in the copied
template is a Poetry component carrying its usual
data-slot parts, and because you own
the source, utility classes can be edited directly in place. Per-part
contracts live on the composed components' pages: