Skip to Content
Nextra 4.0 is released 🎉

Alert

The Alert component is a pixel-art styled notification banner.
It supports multiple variants (info, success, warning, error), an optional title, and dismissible behavior — ideal for displaying feedback messages with a retro aesthetic.


🚀 Usage

Info


import { Alert } from "pixelartui-react"; <Alert message="This is an informational message." variant="info" />

Success


<Alert message="Operation completed successfully!" variant="success" />

Warning


<Alert message="Please review before continuing." variant="warning" />

Error


<Alert message="Something went wrong." variant="error" />

With Title


<Alert title="Heads up!" message="This alert has a title and a message." variant="info" />

Dismissible


<Alert message="You can dismiss this alert." variant="info" dismissible onDismiss={() => console.log("dismissed")} />

Styles


<Alert message="Dark style alert." variant="info" alertStyle="dark" /> <Alert message="Light style alert." variant="info" alertStyle="light" />

🔧 Props

PropTypeDefaultDescription
messagestringThe main alert message text.
variant"success" | "error" | "warning" | "info""info"The visual variant of the alert.
titlestringundefinedOptional title displayed above the message.
dismissiblebooleanfalseShows a dismiss button when true.
alertStyle"dark" | "light""dark"Applies a light or dark theme to the component.
classNamestringundefinedAdds additional CSS classes for custom styling.
onDismiss() => voidundefinedCallback fired when the dismiss button is clicked.
Last updated on