Banner
A persistent, full-width, page-level message bar — distinct from Alert (inline, rounded, sits within content) and Toast (ephemeral, floating).
Playground
A new version is available.
<Banner
variant="info"
message="A new version is available."
action={{ label: 'Update now', onPress: () => {} }}
onDismiss={() => {}}
/>
Variants
Changes saved.
Something went wrong.
Your session will expire soon.
<Banner variant="success" message="Changes saved." onDismiss={() => {}} />
<Banner variant="error" message="Something went wrong." onDismiss={() => {}} />
With an action
A new version is available.
<Banner
variant="info"
message="A new version is available."
action={{ label: 'Update now', onPress: () => {} }}
onDismiss={() => {}}
/>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
message | string | Required. Banner text. | |
title | string | Optional heading above the message. | |
variant | 'default' | 'success' | 'error' | 'warning' | 'info' | 'default' | Visual style (shares Alert's tone system). |
onDismiss | () => void | When provided, renders a dismiss button. | |
icon | ReactNode | Overrides the variant's default icon. Pass null for no icon. | |
dismissIcon | TVajraIconComponent | Icon shown in the dismiss button. Defaults to a plain ✕ glyph. | |
action | { label: string; onPress: () => void } | Optional inline action (e.g. "Retry", "Update now"). |