noora
Sign in

Banner

Announces a message that concerns the whole page, account, or product, across the full width of its container.

Primary

The default status, for announcements. It has an animated dither wave in the background and can show an icon of your choice.

<.banner
  id="banner-primary"
  status="primary"
  title="Introducing Tuist Runners"
  description="Run your CI jobs on Tuist-hosted macOS machines"
>
  <:icon><.server /></:icon>
</.banner>

Statuses

Each status sets the color and a fixed icon.

<.banner
  id="banner-status-information"
  status="information"
  title="You are viewing a public project"
  description="Sign in to see your organization's projects"
/>
<.banner
  id="banner-status-success"
  status="success"
  title="Your organization is on the Pro plan"
  description="Remote cache and previews are now unlimited"
/>
<.banner
  id="banner-status-warning"
  status="warning"
  title="Scheduled maintenance on October 24"
  description="Previews may be unavailable for up to 10 minutes"
/>
<.banner
  id="banner-status-error"
  status="error"
  title="We could not charge your card"
  description="Update your payment method to keep using the remote cache"
/>

Title only

Leave out the description when the title says it all.

<.banner id="banner-title-only" status="success" title="Your email address was confirmed" />

Dismissible

Shows a dismiss button that hides the banner.

<.banner
  id="banner-dismissible"
  status="information"
  title="Bundle size insights are available"
  description="Upload a bundle to compare it against main"
  dismissible
/>

Guidelines

  • Use a banner for messages about the whole page or account, such as billing problems or maintenance. For messages about a specific piece of content, use an alert next to it.
  • Keep the title and description short. They sit side by side on one row, separated by a dot.
  • Match the status to the message: success confirms, warning asks for attention, error reports a problem that needs action, information gives context.
  • Only primary accepts a custom icon . The other statuses always show their own icon.
  • Add at most one link with the action slot, for the next step such as Learn more or Update payment method. Use a large link_button ; it takes the banner's text color.
  • Dismissing hides the banner in the browser with JS.hide . It comes back on the next page load unless you stop rendering it.

API reference

<.banner>

Attribute Type Default Description
description
string
nil
The description of the banner
dismissible
boolean
false
Whether the banner is dismissible or not
id Required
string
–
status
string
"primary"
The status of the banner "primary""error""success""warning""information"
title Required
string
–
The title of the banner
Slot Description
:action
An optional link after the title and description, such as Learn more. Pass a large link_button ; its icon_left and icon_right slots add arrows.
:icon
A custom icon. Only applicable when status is primary