# `RulesteadAdmin.Components.ConfirmComponents`
[🔗](https://github.com/szTheory/rulestead/blob/v1.0.0/lib/rulestead_admin/components/confirm_components.ex#L1)

The shared mutation-confirm contract.

Every governed mutation in the admin (audience edit/archive/delete, flag
cleanup, kill switch, rollout advance/hold/rollback, change-request execution)
follows one preview → confirm → audit shape. `mutation_confirm/1` is the
confirm step's canonical affordance: an optional scope line, slots for
evidence (blast radius, diffs) and extra fields, optional first-class typed
confirmation, a required reason, and a primary-or-danger submit paired with a
back link.

Standardizing this one component is the highest-leverage consistency win —
every confirm screen reads and behaves identically instead of hand-rolling its
own form markup.

# `mutation_confirm`

Renders the canonical confirm form: scope → evidence → typed confirmation →
extra fields → reason → actions.

Drop governance evidence (blast radius, callouts) into the `:evidence` slot and
any custom pre-reason inputs into the `:extra_fields` slot. Prefer the typed
confirmation assigns for production key checks so destructive confirmations
render before the reason field consistently. The reason textarea and the
submit/back actions are always rendered so confirm screens stay visually and
behaviourally uniform.

## Attributes

* `submit_event` (`:string`) (required) - phx-submit event name.
* `submit_label` (`:string`) (required)
* `reason_value` (`:string`) - Defaults to `""`.
* `reason_label` (`:string`) - Defaults to `"Reason (required)"`.
* `reason_required` (`:boolean`) - Defaults to `true`.
* `back_href` (`:string`) - Defaults to `nil`.
* `back_label` (`:string`) - Defaults to `"Back"`.
* `danger?` (`:boolean`) - Defaults to `false`.
* `aria_label` (`:string`) - Defaults to `"Confirm action"`.
* `disabled?` (`:boolean`) - Defaults to `false`.
* `disabled_reason` (`:string`) - Defaults to `nil`.
* `unavailable_reason` (`:string`) - Defaults to `nil`.
* `read_only?` (`:boolean`) - Defaults to `false`.
* `read_only_reason` (`:string`) - Defaults to `nil`.
* `typed_confirmation_label` (`:string`) - Defaults to `nil`.
* `typed_confirmation_name` (`:string`) - Defaults to `"confirmation"`.
* `typed_confirmation_value` (`:string`) - Defaults to `""`.
* `typed_confirmation_required` (`:boolean`) - Defaults to `false`.
* `typed_confirmation_help` (`:string`) - Defaults to `nil`.
* `scope` (`:map`) - optional %{environment:, tenant:, fingerprint:} context line. Defaults to `nil`.
## Slots

* `evidence` - blast radius / diff / callouts shown above the reason.
* `extra_fields` - inputs shown above the reason, e.g. typed confirmation.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
