Component Porchlight CSS

Alert

Inline notifications for contextual feedback - four tones, each WCAG-AA.

52 components 51 stable 1 experimental

Command

Search Porchlight

Alert

The .c-alert renders an inline notification within the page flow. Four tones via [data-tone]: info (default), success, warning, danger. A leading icon anchors the tone visually.

Semantic HTML

<div class="c-alert" data-tone="warning">
  <div class="c-alert__icon"><svg>…</svg></div>
  <div class="c-alert__content">
    <div class="c-alert__title">Approaching limit</div>
    <div class="c-alert__body">You have used 58 of 60 seats.</div>
  </div>
</div>

Class contract

SelectorRole
.c-alertThe container (grid: icon + content).
.c-alert__iconLeading icon slot (tone-colored).
.c-alert__contentTitle + body wrapper.
.c-alert__titleBold heading.
.c-alert__bodySupporting text (muted).
.c-alert__closeOptional dismiss button (top-right).
[data-tone]info (default), success, warning, danger.