---
title: Alert banner
description: An in-page message that requires user attention.
---

<Component path="alert-banner/variants" />

## Best practices

### Content

Give the banner one job. Say what is wrong, then what to do about it, in that order. Keep the description to a sentence or two, and put the detail behind a link rather than in the banner.

Use a title when a short description alone does not identify the problem.

Use icons as sparingly as possible. Only add an icon to a banner if you feel like the content is not clear enough on it's own.

### Actions

Keep to one action. A second is acceptable when it dismisses or defers.

## Card appearance

<Component path="alert-banner/card" />

Use `appearance="card"` for a problem with one resource, shown inline in a detail view: an instance that ran out of memory, a build that failed. The card stays white with a faint tint and border. Only the icon carries the colour, so it does not shout next to charts and metadata.

Put short facts such as counts and times in `AlertBannerMeta`, next to the title. Keep the description to one line. Use `warning` when the resource needs attention. Use `error` when it is broken or blocked now.

## FYI

Do not confuse this with `Alert`, which is the older dialog primitive in `@unkey/ui`.
