Alert

Contextual feedback messages. Built from two Figma components: the Alert states (Primary, Success, Warning, Danger) and the Alerts List (stacked container). All values pulled directly from the LUSTER Figma variables.

There are 9 new messages
Figma Properties
State: Primary
Background: #F2EDFF
Border: #C5B2FF
Icon / Title: #794DFF
Padding: 20px · Gap: 16px · Border: 2px

Component · Alert States

Four semantic variants. Each maps to a palette family for background, border, icon and title color. Warning uses a dashed border.

There are 9 new messages
Primary
This is a primary alert — check it out!
Success
Click to verify your email
Warning
Access denied, contact support
Danger

Component · Alerts List

A titled container that stacks multiple alerts with a 12px gap (alert/list/gap) — exactly as composed in Figma.

Alerts
There are 9 new messages
This is a primary alert — check it out!
Click to verify your email
Access denied, contact support

Design Tokens

These tokens reflect the Alerts List component (Figma: Alert list) — the titled section container, the stacked list, and the alert items it holds. The list stacks alerts with --alertListGap (12px), distinct from each alert's internal --alertGap (16px).

Token NameFigma VariableDefault Value
--alertListContentAlert list/list/content"Alerts"
--alertListGapalert/list/gap12px
--foregroundOnSurfaceforeground/on surface (list title)#24242C
--titleFontSizeTypography/Title/Font/Size16px
--titleFontLineHeightTypography/Title/Font/LineHeight19px
--titleFontWeightTypography/Title/Font/Weight700
--sectionBgColorsection/bg/color#FFFFFF
--sectionPaddingXsection/padding/x24px
--sectionPaddingYsection/padding/y24px
--sectionBorderRadiussection/border/radius0px
--sectionMarginBottomsection/margin-bottom24px
--sectionShadowColorsection/shadow/color#CECBDC
--sectionShadowOffsetXsection/shadow/offset-x0px
--sectionShadowOffsetYsection/shadow/offset-y0px
--sectionShadowBlursection/shadow/blur0px
--alertGapAlert/Gap16px
--alertPaddingXAlert/Padding/X20px
--alertPaddingYAlert/Padding/Y20px
--alertBorderRadiusAlert/Border/Radius0px
--alertBorderWidthAlert/Border/Width2px
--alertPrimaryBgColorAlert/Primary/Bg/Color#F2EDFF
--alertPrimaryBorderColorAlert/Primary/Border/Color#C5B2FF
--alertPrimaryIconColorAlert/Primary/Icon/Color#794DFF
--alertPrimaryTitleFontColorAlert/Primary/Title/Font/Color#794DFF
--alertSuccessBgColorAlert/Success/Bg/Color#E6FAED
--alertSuccessBorderColorAlert/Success/Border/Color#91E8B2
--alertSuccessIconColorAlert/Success/Icon/Color#00CA4B
--alertSuccessTitleFontColorAlert/Success/Title/Font/Color#00CA4B
--alertWarningBgColorAlert/Warning/Bg/Color#FDF7E6
--alertWarningBorderColorAlert/Warning/Border/Color#F7DD91
--alertWarningIconColorAlert/Warning/Icon/Color#EDB000
--alertWarningTitleFontColorAlert/Warning/Title/Font/Color#EDB000
--alertDangerBgColorAlert/Danger/Bg/Color#FEE9E9
--alertDangerBorderColorAlert/Danger/Border/Color#FAA2A2
--alertDangerIconColorAlert/Danger/Icon/Color#F32727
--alertDangerTitleFontColorAlert/Danger/Title/Font/Color#F32727
--caption2FontSizeTypography/Caption-2/Font/Size12px
--caption2FontLineHeightTypography/Caption-2/Font/LineHeight14px
--caption2FontWeightTypography/Caption-2/Font/Weight700
--bodyFontFamilyBody/Font/FamilyInter

Usage Guidelines

✓ DO

Match the state to intent: Success for confirmation, Danger for errors.

✓ DO

Keep alert copy short and actionable; lead with what happened.

✗ DON'T

Don't stack more than a few alerts — group them in an Alerts List.

✗ DON'T

Don't rely on color alone — always include the icon and text.

Implementation

Values shown are the Diamond brand, Light mode defaults (the Figma file's default mode). Other brands (Amber, Opal) and Dark mode resolve to different values via the Color Theme & Component Brand collections.

import './Alert.css';
import { InboxIcon } from './icons';

export interface AlertProps {
  state?: 'primary' | 'success' | 'warning' | 'danger';
  icon?: React.ReactNode;
  children: React.ReactNode;
}

export const Alert = ({ state = 'primary', icon, children }: AlertProps) => (
  <div className={`alert alert--${state}`} role="alert">
    <span className="alert__icon">{icon ?? <InboxIcon />}</span>
    <span className="alert__title">{children}</span>
  </div>
);

export const AlertsList = ({ title = 'Alerts', children }) => (
  <div className="alerts-list">
    <h3 className="alerts-list__title">{title}</h3>
    {children}
  </div>
);