Feedback
Banner
A full-width, edge-to-edge notice for a page or section: a tinted strip with a left accent bar.
Installation #
With the Nuxt module, every component is auto-imported — there is nothing to add. In a plain Vue project, import what you use:
Copy
import { JBanner } from '@juxtui/ui'Usage #
Copy
<JBanner variant="warning" title="Your trial ends in 3 days" description="Add a payment method to keep access.">
<template #actions>
<JButton variant="outline" size="sm">Add payment method</JButton>
</template>
</JBanner>Banners run edge-to-edge and use a tinted fill with a left accent bar — JAlert sits inline in a card or form with a plain bordered surface instead. Pick banner for page- or section-level notices, alert for local ones.
Dismissing is left to you: dismissible shows the close button and emits dismiss, but the banner stays mounted until you act on it (see the v-if in the dismissible example).
Variants & examples #
Variants#
Dismissible#
API #
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | 'neutral' | 'info' | 'success' | 'warning' | 'destructive' | 'neutral' | Accent colour, fill and default icon. |
| title | string | — | Heading. Also used as the region’s accessible name. |
| description | string | — | Supporting text. Overridden by the default slot. |
| dismissible | boolean | false | Show a close button; emits dismiss on click. |
| hideIcon | boolean | false | Hide the leading icon. |
Events
| Event | Payload | Description |
|---|---|---|
| dismiss | void | The close button was clicked. |
Slots
| Slot | Props | Description |
|---|---|---|
| default | — | Replaces description with custom content. |
| icon | — | Replaces the default variant icon. |
| actions | — | Buttons shown at the end of the banner. |
Accessibility #
- Rendered as
role="region"labelled bytitle, so it’s reachable as a landmark when one is set. - The variant icon is
aria-hidden; colour and icon both reinforce the text rather than replace it.