Skip to content
Storybook

Alert

Inline message about the current page or task. Tone sets the icon and tint; text stays neutral.

Preview

React · live from the Storybook
Alert preview

HTML and CSS

The same component as plain HTML with pixels-ui.css, no framework needed.

We’ve just released a new feature

Pixels Audit now checks buttons, icons and fonts in any Figma file.

Usage

  • role="status" for info/success; role="alert" for warning/danger.

Installation

Included in the core files. No extra install.

HTML
<link rel="stylesheet" href="/css/pixels-tokens.css">
<link rel="stylesheet" href="/css/pixels-ui.css">
<script src="/js/pixels-ui.js" defer></script>

Examples

Tones

Info, Success, Warning, Danger and Neutral.

Changes saved

Scheduled maintenance on Sunday

API reference

Class / attributeTypeDescription
px-alertclassInfo tone by default.
px-alert--success · --warning · --danger · --neutralclassTone.
__content · __title · __desc · __actions · __closeclassSlots.
data-px-dismissible + data-px-dismissattributeClose removes the alert.

Figma properties

Alert10 variants · page “Alerts & Notifications”Open

Inline message about the current page or task. Tone sets icon and tint; text stays neutral for contrast. Use role=status (info/success) or role=alert (warning/danger). RTL text: Title/Description prop…

PropertyTypeValues
TitleText“We’ve just released a new feature”
DescriptionText“Your changes have been saved.”
ActionsBoolean—
CloseBoolean—
ToneVariantInfo Success Warning Danger Neutral
DirectionVariantLTR RTL

Design tokens

Component tokens from the Figma Component collection. Override them to restyle just this component.

TokenAliasLight value
--px-alert-radiusradius-1616px
--px-alert-paddingspacing-1616px
--px-alert-width560px560px
--px-alert-gapspacing-88px

Accessibility

  • Do not use role="alert" for messages that were on the page at load.