structyl

Banner API

View component

The full prop reference for the Banner component. A full-width, site-level announcement bar with variants, an optional action, and a dismiss button.

Import

tsx
import { Banner } from '@structyl/styled';

Props

Banner

A full-width, site-level announcement bar with tone variants, an optional leading icon and trailing action, and a dismiss button. Extends the native div element.

PropTypeDefault
variant#'default' | 'info' | 'success' | 'warning' | 'error' | 'brand'

Visual tone. 'brand' uses the primary color fill.

'default'
align#'start' | 'center'

Content alignment within the bar.

'start'
icon#React.ReactNode

Leading icon rendered before the content.

action#React.ReactNode

Trailing action (e.g. a link or button) rendered after the content.

dismissible#boolean

Show an accessible dismiss button.

false
onDismiss#(() => void) | undefined

Called when the dismiss button is clicked.

Source code

If you didn't find what you need here, read the component implementation .

structyl — Accessible React Component Library