Appearance
Inline Banner
A banner that shows a message inside a page or section. It has a header (title), a text (description), an optional icon, optional actions in the default slot and an optional close button.
Design
All types share the same text styles. The header and description colors are the same for every type.
| Part | Typography token | Spec | Color token |
|---|---|---|---|
| Header | typo-body-medium | Inter 450, 12px / 16px | --color-content-primary |
| Description | typo-body-xsmall-tight | Inter 450, 10px / 12px | --color-content-tertiary |
There is no gap between the header and the description.
| Type | Background | Border | Icon color | Padding, radius |
|---|---|---|---|---|
| (none) | --color-background-neutral-subtle | --color-border-neutral-subtle | --color-content-secondary | default |
informative | transparent | none | --color-content-informative-secondary | 8px / 12px, no radius |
success | --color-background-positive-subtle | --color-border-positive-subtle | --color-content-positive-secondary | default |
warning | --color-background-warning-subtle | --color-border-warning-subtle | --color-content-warning-secondary | default |
error | --color-background-negative-subtle | --color-border-negative-subtle | --color-content-negative-secondary | default |
The icon is 16px, centered horizontally in a 20px wide container, with 8px (--space-component-gap-small) between the container and the content. The informative icon is the outline phosphor/info.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
type | "informative" | "success" | "warning" | "error" | - | Banner style. Without it the banner is neutral |
title | string | - | Header |
description | string | - | Text below the header |
icon | icon name | by type | Replaces the icon of the type (phosphor/info for neutral and informative) |
noIcon | boolean | false | Hides the icon |
hasCloseButton | boolean | false | Shows a close button, emits close |
The default slot holds actions (usually SCAButton) below the text. Without actions nothing is rendered for them, so there is no extra gap below the text.
Placement
The informative banner has no box: its 8px top and bottom and 12px left and right padding (--space-component-padding-small / --space-component-padding-medium) match a section's inset. Put it in a container with no padding of its own, such as a padding-less section.