2023-05-26 15:58:06 +02:00
|
|
|
import { Meta, Story, Controls, Canvas, Primary } from "@storybook/addon-docs";
|
2022-10-17 20:25:55 +02:00
|
|
|
|
2023-05-26 15:58:06 +02:00
|
|
|
import * as stories from "./banner.stories";
|
|
|
|
|
|
|
|
<Meta of={stories} />
|
2022-10-17 20:25:55 +02:00
|
|
|
|
|
|
|
# Banner
|
|
|
|
|
2023-05-08 14:46:59 +02:00
|
|
|
Banners are used for important communication with the user that needs to be seen right away, but has
|
|
|
|
little effect on the experience. Banners appear at the top of the user's screen on page load and
|
|
|
|
persist across all pages a user navigates to.
|
|
|
|
|
2023-06-27 21:46:44 +02:00
|
|
|
- They should always be dismissible and never use a timeout. If a user dismisses a banner, it should
|
2023-05-08 14:46:59 +02:00
|
|
|
not reappear during that same active session.
|
|
|
|
- Use banners sparingly, as they can feel intrusive to the user if they appear unexpectedly. Their
|
|
|
|
effectiveness may decrease if too many are used.
|
2022-10-17 20:25:55 +02:00
|
|
|
- Avoid stacking multiple banners.
|
2023-05-08 14:46:59 +02:00
|
|
|
- Banners support a button link (text button).
|
2022-10-17 20:25:55 +02:00
|
|
|
|
2023-05-26 15:58:06 +02:00
|
|
|
<Primary />
|
|
|
|
|
|
|
|
<Controls />
|
|
|
|
|
2022-10-17 20:25:55 +02:00
|
|
|
## Types
|
|
|
|
|
2023-05-08 14:46:59 +02:00
|
|
|
Icons should remain consistent across these types. Do not change the icon without consulting
|
|
|
|
designers.
|
2022-10-17 20:25:55 +02:00
|
|
|
|
|
|
|
Use the following guidelines to help choose the correct type of banner.
|
|
|
|
|
|
|
|
### Premium
|
|
|
|
|
2023-05-26 15:58:06 +02:00
|
|
|
<Story of={stories.Premium} />
|
2022-10-17 20:25:55 +02:00
|
|
|
|
|
|
|
Used primarily to encourage user to upgrade to premium.
|
|
|
|
|
|
|
|
### Info
|
|
|
|
|
2023-05-26 15:58:06 +02:00
|
|
|
<Story of={stories.Info} />
|
2022-10-17 20:25:55 +02:00
|
|
|
|
|
|
|
Used to communicate release notes, server maintenance or other informative event.
|
|
|
|
|
|
|
|
### Warning
|
|
|
|
|
2023-05-26 15:58:06 +02:00
|
|
|
<Story of={stories.Warning} />
|
2022-10-17 20:25:55 +02:00
|
|
|
|
|
|
|
Used to alert the user of outdated info or versions.
|
|
|
|
|
|
|
|
### Danger
|
|
|
|
|
2023-05-26 15:58:06 +02:00
|
|
|
<Story of={stories.Danger} />
|
2022-10-17 20:25:55 +02:00
|
|
|
|
|
|
|
Rarely used, but may be used to alert users over critical messages or very outdated versions.
|
|
|
|
|
|
|
|
## Accessibility
|
|
|
|
|
2023-05-08 14:46:59 +02:00
|
|
|
Banners sets the `role="status"` and `aria-live="polite"` attributes to ensure screen readers
|
|
|
|
announce the content prior to the test of the page. This behaviour can be disabled by setting
|
|
|
|
`[useAlertRole]="false"`.
|