Alert
catnip-alert communicates application state with a semantic intent, an intent-mapped Catnip icon, and an optional assistive-technology announcement. Use it for in-flow feedback such as completed actions, warnings, errors, and contextual information.
Four appearances cover different placement needs. All stay in document flow; the consumer owns placement.
- Banner — prominent feedback in the page layout, with optional title and close button.
- Inline — compact feedback beside or beneath related content.
- Inline inverse — compact feedback on a strong intent-colored background.
- Text — icon and message without a container background.
For viewport overlay feedback, use Toast.
The description prop handles plain text. Use the default slot when the message needs rich content such as a link or action button. Slotted content replaces description.
Live example
Guidelines
Choose an appearance
Use Banner for a message that belongs to a page, section, or workflow and benefits from a title or explicit close button. Banner stays in document flow, so the consumer owns its placement.
Use Inline, Inline inverse, or Text for compact messages beside related content. These appearances render the description/default slot and icon without a title or close button. The consumer owns placement and surrounding spacing.
Use Toast for feedback caused by a recent user or system action when it should remain visible across the current viewport.
Write useful messages
Keep the title short and state the outcome first. Use the description to explain impact or the next useful step. Do not encode meaning only in the intent color or icon.
Use the plain description prop for ordinary copy. Use the default slot for links or actions:
<catnip-alert intent="warning" appearance="banner" alert-title="Verification needed">
Check the entered details, then
<catnip-link appearance="underline" right-icon="" href="/help">review the verification guide</catnip-link>.
</catnip-alert>Do not also pass description in this case; slotted content replaces it and development builds warn about the ignored prop.
Dismissal
Banner can expose a close button (showCloseButton, default true). Compact appearances never show it. A dismissed instance is one-shot; remount or recreate it when the same event needs to be announced again.
Timed viewport dismissal belongs on Toast, not Alert.
Icons
Leave leftIcon="" to use the Figma-mapped intent icon. Pass a valid CatnipIconName to change it with editor autocomplete, or provide leftIconSlot for custom visual content:
<catnip-alert appearance="inline" description="Identity check is running.">
<catnip-spinner slot="leftIconSlot" size="20"></catnip-spinner>
</catnip-alert>The icon is decorative. Put all meaningful status text in the title or message.