InstallComponentsExample

Alert

A static callout for important information, coloured by tone.

How it helpsOne class plus a tone. Pass any colour with style="--tone:…" and the tint, border and title all follow it.

Tones

Heads upYour statement for November is ready.
Payment received₹12,400 credited to HDFC ••4521.
Approaching limitYou've used 82% of your dining budget.
Custom colourAny hex works through --tone.
export default function Example() {
  return (
    <>
      <div className="flex flex-col gap-3 w-full">
        <div className="alert"><strong>Heads up</strong>Your statement for November is ready.</div>
        <div className="alert" data-tone="good"><strong>Payment received</strong>₹12,400 credited to HDFC ••4521.</div>
        <div className="alert" data-tone="warn"><strong>Approaching limit</strong>You've used 82% of your dining budget.</div>
        <div className="alert" data-tone="bad" role="alert"><strong>Sync failed</strong>We couldn't reach your bank. Try again later.</div>
        <div className="alert" style={{ "--tone": "#7c3aed" }}><strong>Custom colour</strong>Any hex works through --tone.</div>
      </div>
    </>
  );
}
<div class="flex flex-col gap-3 w-full">
  <div class="alert"><strong>Heads up</strong>Your statement for November is ready.</div>
  <div class="alert" data-tone="good"><strong>Payment received</strong>₹12,400 credited to HDFC ••4521.</div>
  <div class="alert" data-tone="warn"><strong>Approaching limit</strong>You've used 82% of your dining budget.</div>
  <div class="alert" data-tone="bad" role="alert"><strong>Sync failed</strong>We couldn't reach your bank. Try again later.</div>
  <div class="alert" style="--tone:#7c3aed"><strong>Custom colour</strong>Any hex works through --tone.</div>
</div>

API

NameTypeDescription
.alertclassContainer.
strongtagOptional title, uses the tone colour.
data-tonegood | warn | bad | info | ink | neutralPreset colour.
--toneCSS varAny custom colour.
role="alert"attrAdd for urgent, live messages.