Banner
A full-width message for a page-wide or app-wide status. It carries a semantic icon based on the variant and optional actions, and it can be dismissible (data-ts-dismissible) or stick to the top (is-sticky).
Feedback and status · TaishoDS Core, in plain HTML.
Examples
One working example per case. Each example is the HTML of its preview—copy it as is, and with Core’s CSS and JS loaded, it looks and works the same.
Dismissible plan notice
Class reference
Every value of each modifier, with its HTML ready to copy.
Variant
The color for the notice’s tone: default, success, warning, info, or danger.
States
is-sticky pins the banner to the top while scrolling.
When to use
- The message affects the whole page or the whole app, like an outage, an expired plan, or maintenance mode.
- It has to be seen on arrival, without the user looking for it.
- It can carry an action to resolve it right there (retry, upgrade the plan).
When not to use
- The notice is about part of the content, not the whole page →
note. - It confirms something the user just did and can go away on its own →
toast. - It’s an error on a form field → the
fielderror.
Do
- One banner at a time. If two compete, neither gets read.
- Put the way out in the banner itself—what happened and what to do about it.
- If it’s
is-sticky, make it dismissible—a fixed banner that won’t go away gets in the way.
Don’t
- Don’t use it as a permanent ad. People stop seeing it, and it covers content.
- Don’t let color carry the meaning alone. The text has to say it.
TaishoDS Core
Needs Core’s JS, which hooks in through data-ts-* attributes.
The banner can be dismissed, and Core handles that.
Core hooks into it through these attributes. They go in the markup, and there’s nothing to initialize.
data-ts-dismissdata-ts-dismissible
What it does: The close button removes the banner from the DOM (or hides it) and, when needed, remembers that it was dismissed.
From the CDN, without a build, load taisho.banner.css along with taisho.base.css. Also load:
taisho.button.csstaisho.icon.csstaisho.spinner.css
For how Core works in general, see Behavior.
Accessibility
- Write it as
<div role="region" aria-label="…">, with a unique name for each notice (notrole="banner"—that role is the page header, and a site with its own<header>would end up with two). Two notices with the same name can’t be told apart in the list of regions. - Color isn’t the only carrier of meaning. The text message always conveys the status.
- The close button has its own
aria-label.
Verification
What was actually tested. Anything that wasn’t tested says so—we’d rather say “not verified” than claim too much.
- axe WCAG 2.2 A + AA in a real browser, in light and dark mode, before every release.
- keyboard Adds no keys of its own—it uses the browser’s native behavior.
- screen reader Not verified with a screen reader. Test it in your own combination of components, not just here, where each one appears alone and on its happy path.