Banner

Alignment target:@astryxdesign/core v0.7.1 · Banner

A new software update is available.
Your changes have been saved.
Your trial expires in 3 days.
Upgrade to keep access to all features.
Payment failed.
Update your billing information to continue.

Usage #

Use Banner for persistent messages that require attention or action.

Vue
<script setup lang="ts">
import { Banner } from '@astryx-vue/core/Banner'
</script>

<template>
  <Banner
    status="success"
    title="Changes saved"
    description="Your settings are up to date."
    is-dismissable
  />
</template>

Import the theme once in the application entry:

TypeScript
import '@astryx-vue/themes/neutral.css'

Anatomy

ElementDescription
Banner frameOuter frame that groups the status surface and optional content surface. It carries whole-banner elevation and, for elevated card banners, the radius that shapes that silhouette.
Status surfaceThe primary painted surface. It communicates status and contains the icon, title, description, actions, and controls.
IconAutomatically set based on the status (info, warning, error, success).
TitleThe main message. Always required.
DescriptionAdditional detail below the title.
Action buttonA button for the user to act on the message, like "Review" or "Retry".
Dismiss buttonLets the user close the banner. Enabled by setting isDismissable.
Content surfaceSecondary surface for extra detail below the status surface, like a list of errors. Sits behind an expand/collapse toggle by default; set collapsible to false to keep it visible.

Best practices #

GuidancePractices
DoPick a status that matches the message: info for updates, warning for caution, error for problems, success for confirmations.
DoUse the card container inside page content and the section container for full-width messages that span the entire page.
DoMake info and success banners dismissable. Keep error banners visible until the user fixes the issue.
DoKeep titles short and scannable: "Payment failed" not "There was a problem processing your most recent payment."
Don'tUse Banner for short-lived messages that disappear on their own; use Toast instead.
Don'tStack multiple banners with the same status; combine related messages into one banner.

Examples #

Banner — Collapsible

Configuration changes detected
Review the changes before they take effect.
Changed settings:
Open in Playground

One banner with an action, a dismiss control, and details that start open. The details go in the default slot.

Banner — Dismiss

Deployment complete
Version 3.2.0 is now live in production.
Scheduled maintenance tonight
The system will be briefly unavailable from 2:00–3:00 AM.
New feature available
Try the new dashboard layout in Settings.
Open in Playground

isDismissable lets the user close the banner after reading it.

Banner — Floating

You have unsaved changes
A raised banner reads as an overlay floating above the page.
Open in Playground

elevation med lifts the banner off the page, so it reads as a floating notice.

Banner — Full width

Scheduled downtime
All services will be unavailable on Sunday from 2:00–4:00 AM.
Welcome to the new dashboard
We have redesigned the layout based on your feedback.
Open in Playground

With container set to section, the banner runs edge to edge without a rounded corner, for a notice at the top of the page.

Banner — Statuses

A new software update is available
Version 2.4.1 includes performance improvements and bug fixes.
Changes saved
Your profile information has been updated successfully.
Storage almost full
You have used 90% of your available storage.
Build failed
3 tests did not pass. Check the logs for details.
Open in Playground

Info, success, warning, and error, for an update, a confirmation, a caution, and a problem.

Banner — Action

Your trial expires in 3 days
Upgrade now to keep access to all features.
API key expires soon
Generate a new key before December 1 to avoid service interruption.
Payment failed
We could not process your last payment.
Open in Playground

A button in the end slot lets the user act on the message.

Usage guidance #

The status prop sets the tone of a banner, and picking the wrong one makes readers misjudge how urgent the message is. The list below covers which status fits which kind of message, plus two usages that are easy to overlook.

  • Use info for general information and updates.
  • Use success for the result of a successful action.
  • Use warning for situations that call for caution.
  • Use error for problems that block progress.
  • Set :collapsible="false" for details that users must read, so those details stay visible and no click is needed to open them. Keep the default toggle when the detail is long enough to bury the banner's own message.
  • Announce an async outcome from the transition that produced it, with useAnnounce.

status controls color and icon only. It does not create a live region. Add role="status" only when the visible banner should stay a persistent semantic mirror, and reserve role="alert" for genuinely urgent content that should interrupt current speech. Content already on the page at first render is not guaranteed to be announced again.

For a single field validation message, use FieldStatus.