Skip to content

Banner

Props ​

PropertyTypeDefaultDescription
status'info' | 'success' | 'warning' | 'error'—Required. Message status.
titlestring—Required. Message title.
descriptionstring—Supporting text below the title.
iconComponent—Custom decorative icon.
isDismissablebooleanfalseShows the dismiss button. Dismissal hides the component.
dismissLabelstringDismiss {title}Accessible name for the dismiss button.
container'card' | 'section'cardcard has rounded corners. section has square corners.
elevation'none' | 'low' | 'med' | 'high'noneShadow depth for the whole banner.
collapsiblebooleantrueWhether detail content can collapse.
defaultIsOpenbooleanfalseInitial expansion when isOpen is not bound.
v-model:isOpenboolean—Controls expansion from the parent.
expandLabelstringExpand detailsAccessible name for the expand button.
collapseLabelstringCollapse detailsAccessible name for the collapse button.

Slots ​

  • Default: details below the header.
  • title: replaces the visible title. The title prop remains required.
  • description: replaces the supporting text.
  • icon: replaces the decorative status icon.
  • end: action buttons at the end of the header.

Title, description and detail slots accept block content.

Expanding and collapsing ​

  • Detail content enables the expand button.
  • Details start collapsed by default.
  • defaultIsOpen sets the initial state only.
  • v-model:isOpen controls the current state.
  • collapsible set to false keeps details visible.
  • Collapsing unmounts the details.
  • If a parent closes focused details, focus returns to the expand button.
vue
<Banner v-model:is-open="open" status="info" title="Configuration changes">
  <p>Review the updated settings before continuing.</p>
</Banner>

Dismissal ​

  • isDismissable shows a dismiss button.
  • Clicking it hides the component.
  • The component emits dismiss.
  • Dismissal tries to restore focus to the element used before entering the banner.
  • Remount the component or change its key to show it again.

Events and template references ​

  • update:isOpen(value): requests an expansion change.
  • dismiss(): dismisses the banner.
  • element: the root HTMLDivElement | null. It becomes null after dismissal.

Localization ​

Provide translated control labels:

  • dismissLabel: dismiss button.
  • expandLabel: expand button.
  • collapseLabel: collapse button.

Theme ​

css
.my-banner {
  --astryx-banner-info-background: #ecfdf5;
  --astryx-banner-info-foreground: #065f46;
}
  • --astryx-banner-info-background: information background.
  • --astryx-banner-info-foreground: information text and icon.
  • --astryx-banner-success-background: success background.
  • --astryx-banner-success-foreground: success text and icon.
  • --astryx-banner-warning-background: warning background.
  • --astryx-banner-warning-foreground: warning text and icon.
  • --astryx-banner-error-background: error background.
  • --astryx-banner-error-foreground: error text and icon.
  • --astryx-banner-content-background: detail background.
  • --astryx-banner-border: detail border.
  • --astryx-radius-container: card corner radius.

Neutral follows the active light or dark mode.