GitHub

Danger Zone

A bordered section that corrals one or more destructive actions behind clear danger-colored chrome — a tinted background, danger border, and danger-colored heading — so a misclick is harder to make by accident.

Stable .astro import EsaDangerZone from '@esa/ecology/esa-danger-zone.astro';

Preview

Danger Zone

Deleting this project also removes its annotations and history. This cannot be undone.

<EsaDangerZone description="Deleting this project also removes its annotations and history. This cannot be undone.">
  <EsaButton variant="danger">Delete project</EsaButton>
</EsaDangerZone>

Multiple actions

Project any number of destructive actions into the default slot — they wrap on a shared gap.

Irreversible actions

These operations cannot be undone.

<EsaDangerZone heading="Irreversible actions" description="These operations cannot be undone.">
  <EsaButton variant="danger" appearance="outline">Archive</EsaButton>
  <EsaButton variant="danger">Delete</EsaButton>
</EsaDangerZone>

Heading only

The description is optional — omit it for a compact zone.

Danger Zone

<EsaDangerZone>
  <EsaButton variant="danger">Revoke access</EsaButton>
</EsaDangerZone>

API

PropTypeDefaultDescription
heading string 'Danger Zone' Section heading, rendered in danger color and wired to the group via aria-labelledby.
description string — Optional supporting copy explaining the consequence of the actions.

The default slot holds the destructive action(s) or content — typically one or more esa-button elements with variant="danger".

Accessibility

  • Renders a <section role="group"> labelled by its heading via aria-labelledby, so assistive tech announces the grouping and its name.
  • The heading is a real <h3> — keep the document outline in mind and override the level in your own markup if the surrounding context needs it.
  • Danger emphasis is conveyed by a tinted background, full border, and heading color — never by color alone for meaning; the heading text itself names the intent.
  • Pair each destructive action with a confirmation step (e.g. a confirm dialog) so the zone is the warning and the dialog is the gate.

Theming surface

Every public token this component reads, extracted from its source at build time, split by blast radius: the hooks that belong to this component, then the shared and system tokens it consumes alongside everything else. The Resolves to column walks each token's real lineage — component → semantic → primitive → raw value — so you can see exactly where re-pointing it lands. A spoke re-skins by overriding these in its theme-<slug>.css; component internals are never edited. No hook for what you need? File it with /request-lego.

Type roles it names

This component does not set a size, weight, face or tracking of its own — it names a composite, and the composite carries all five. A composite is a class rather than a token, so none of it appears in the tables below; re-theme text by re-pointing the token family, not by editing the component.

RoleRe-pointReach
.typography-body-md
  • --typography-body-md-font-family 'DM Sans', sans-serif via --typography-font-family-sans → --font-family-dm-sans
  • --typography-body-md-font-size clamp(0.75rem, 0.66rem + 0.44vw, 0.9375rem) via --font-size-200
  • --typography-body-md-font-weight 350 via --typography-font-weight-regular → --font-weight-350
  • --typography-body-md-letter-spacing 0.01em via --letter-spacing-default
  • --typography-body-md-line-height 1.6 via --line-height-normal
+28 more components esa-app-shell, esa-breadcrumbs, esa-card, esa-checkbox, esa-checkbox-group, esa-collapsible, esa-combobox, esa-command-palette, esa-confirm-dialog, esa-container, esa-dialog, esa-dropdown-menu, esa-empty-state, esa-entity-search, esa-form-field, esa-header-nav, esa-input-tag, esa-nav-dropdown, esa-page-header, esa-popover, esa-progress-bar, esa-radio-group, esa-select, esa-side-dialog, esa-snackbar-item, esa-switch-toggle, esa-tab-layout, esa-textarea
.typography-label-md
  • --typography-label-md-font-family 'DM Sans', sans-serif via --typography-font-family-sans → --font-family-dm-sans
  • --typography-label-md-font-size clamp(0.75rem, 0.66rem + 0.44vw, 0.9375rem) via --font-size-200
  • --typography-label-md-font-weight 500 via --typography-font-weight-medium → --font-weight-500
  • --typography-label-md-letter-spacing 0.01em via --letter-spacing-default
  • --typography-label-md-line-height 1.6 via --line-height-normal
+33 more components esa-app-bar, esa-breadcrumbs, esa-button-group, esa-button-toggle, esa-card, esa-checkbox-group, esa-color-picker, esa-combobox, esa-command-palette, esa-confirm-dialog, esa-date-picker, esa-dialog, esa-empty-state, esa-entity-search, esa-file-upload, esa-filter-container, esa-form-field, esa-header-nav, esa-input-tag, esa-link-column, esa-page-header, esa-pillbox, esa-popover, esa-progress-bar, esa-radio-group, esa-range-slider, esa-select, esa-side-dialog, esa-sidebar-nav, esa-stat, esa-text-field, esa-textarea, esa-tooltip
.typography-title-sm-strong
  • --typography-title-sm-strong-font-family 'DM Sans', sans-serif via --typography-font-family-sans → --font-family-dm-sans
  • --typography-title-sm-strong-font-size clamp(0.8125rem, 0.71rem + 0.5vw, 1.0625rem) via --font-size-250
  • --typography-title-sm-strong-font-weight 550 via --typography-font-weight-semibold → --font-weight-550
  • --typography-title-sm-strong-letter-spacing 0.01em via --letter-spacing-default
  • --typography-title-sm-strong-line-height 1.6 via --line-height-normal
+1 more component esa-card

Wired to this component

None. This component has no hooks of its own — it themes entirely through the shared tokens below, so every override here also moves its siblings.

Shared tokens it reads

Owned by a family or by the semantic layer. Still overridable — but scope the override (esa-foo { --form-border-color: … }) unless you mean to move everything that reads it. Reach says what else that is.

Token Reach Resolves to
--border-width-default semantic every component 1px via --border-width-100
--color-background-utility-danger-subtle semantic every component #fffcfc via --color-red-1
--color-border-utility-danger semantic every component #fdbdbe via --color-red-6
--color-content-default-secondary semantic every component #646464 via --color-gray-11
--color-content-utility-danger semantic every component #ce2c31 via --color-red-11
--radius-md semantic every component 0.5rem via --radius-200
--spacing-200 primitive every component 0.5rem
--spacing-300 primitive every component 0.75rem