Installation
Section titled “Installation”- Package
@bigbang/ui- Import
import { Banner } from '@bigbang/ui';- Source
- Banner.tsx
- Storybook
- Banner · Playground
Banner is in the @bigbang/ui package.
import { Banner, Link } from '@bigbang/ui';
<Banner tone="warning" action={<Link href="/status">Details</Link>}> Maintenance is planned tonight from 23.00 to 01.00.</Banner>;childrenRequired- Description
- The message: one sentence about the whole app or page, such as planned maintenance.
- Type
ReactNode
tone- Description
- Meaning and colour:
infofor announcements,warningfor something that affects work,dangerfor an outage or a blocked account,successrarely. - Type
AlertTone- Default
'info'
action- Description
- One link or button after the message, such as "Ayrıntılar".
- Type
ReactNode
dismissible- Description
- Shows a close button. The banner fades out and
onDismissruns; store the dismissal so it does not come back. - Type
boolean- Default
false
onDismiss- Description
- Runs after the banner has been dismissed and has faded out.
- Type
() => void
dismissLabel- Description
- Accessible name of the close button. Defaults to the
ui.alert.dismisslibrary string ("Uyarıyı kapat" or "Dismiss"). - Type
string
announce- Description
- Announces the banner when it appears after the page has loaded:
dangerasrole="alert", other tones asrole="status". - Type
boolean- Default
false
Data attributes
Section titled “Data attributes”data-component="banner"anddata-tone: on the root.data-ending-style: while it is closing.