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"
/>
With a link
The
action
slot adds a link after the description. Arrows come from the link button's icon slots.
<.banner
id="banner-action-success"
status="success"
title="You're on the Pro plan"
description="Unlimited cache and previews"
>
<:action>
<.link_button label="See plan" size="large" href="#">
<:icon_right><.chevron_right /></:icon_right>
</.link_button>
</:action>
</.banner>
<.banner
id="banner-action-error"
status="error"
title="Your payment failed"
>
<:action>
<.link_button label="Update card" size="large" href="#" />
</:action>
</.banner>
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:
successconfirms,warningasks for attention,errorreports a problem that needs action,informationgives context. -
Only
primaryaccepts a customicon. The other statuses always show their own icon. -
Add at most one link with the
actionslot, for the next step such as Learn more or Update payment method. Use a largelink_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.