Prototype Library

Alert Box

The inherited Ecology alert, wearing the Biochar Atlas skin. An inline status message with a variant-mapped icon, optional title, and optional dismiss control; tones resolve from the spoke's semantic tokens — warning is the score amber.

Inherited .astro import EsaAlertBox from '@esa/ecology/esa-alert-box.astro';

Preview

Estimates only
Scores are screening-level guidance, not a prescription.
<AlertBox variant="info" title="Estimates only">
  Scores are screening-level guidance, not a prescription.
</AlertBox>

Variants

Heads up
Soil properties were auto-derived from SSURGO.
Saved
Your assessment was saved successfully.
Check this
Manual soil-test values override the SSURGO defaults.
Error
Something went wrong while scoring.
<AlertBox variant="info" title="Heads up">Soil properties were auto-derived from SSURGO.</AlertBox>
<AlertBox variant="success" title="Saved">Your assessment was saved successfully.</AlertBox>
<AlertBox variant="warning" title="Check this">Manual soil-test values override the SSURGO defaults.</AlertBox>
<AlertBox variant="danger" title="Error">Something went wrong while scoring.</AlertBox>

States

The title is optional — omit it for a compact single-line alert. With dismissable, a close button appears and a dismissed event bubbles on click.

A compact, single-line alert with just a message.
Dismiss me
Click the × to hide this alert.
<AlertBox variant="info">A compact, single-line alert with just a message.</AlertBox>
<AlertBox variant="warning" title="Dismiss me" dismissable={true}>Click the × to hide this alert.</AlertBox>

API

PropTypeDefaultDescription
variant 'info' | 'success' | 'warning' | 'danger' 'info' Tone — drives the background, border, and auto-mapped icon.
title string Optional bold heading above the message.
dismissable boolean false Shows a close button that hides the alert and emits a dismissed event.

Events

EventTypeDefaultDescription
dismissed CustomEvent Bubbles when the close button is clicked (dismissable only).