Diwa Design System

Banner

A floating top-of-viewport notification for global, non-blocking feedback. Supports semantic states, optional action, dismiss behavior, and timed or persistent visibility.

Properties

NameTypeDefaultDescription
openbooleanfalseControls visibility state for slide in/out behavior.
state'info' | 'success' | 'warning' | 'error''info'Semantic state controlling icon, colors, and live-region urgency.
headingstring''Optional heading displayed before description.
descriptionstring''Description text. Falls back to default slot when empty.
persistentbooleanfalseWhen true, disables auto-dismiss regardless of duration value.
durationnumber6000Auto-dismiss delay in ms when persistent is false. Set 0 to disable timer.
dismissButtonbooleantrueShows or hides dismiss control.
actionLabelstringundefinedOptional action button label.
actionLoadingbooleanfalseRenders loading state for action control.
theme'dark' | 'light''dark'Per-component theme override.

Events

NameDetail typeBubblesDescription
dismissvoidNoEmitted when user dismisses, auto-dismiss timer fires, or hide() is called.
actionvoidNoEmitted when action button is activated.

Methods

NameSignatureDescription
show() => Promise<void>Programmatically opens the banner and starts timer when applicable.
hide() => Promise<void>Programmatically closes banner and emits dismiss.

Slots

SlotDescription
defaultFallback content used when description is empty.

CSS custom properties

NameDefaultDescription
--diwa-banner-position-top90pxTop offset for desktop/tablet floating position.
--diwa-banner-position-top-mobile64pxTop offset used under 480px viewport width.