Banner
Reusable banner component.
Usage
Components are auto-discovered. Use the component directly in any .wrn view:
<Banner
text="Announcement"
href="href"
actionLabel="Learn more"
variant="brand"
/>Legacy mount name: data-component="Banner".
Props and attributes
| Prop | Type | Requirement | Default |
|---|---|---|---|
class | string | Optional | "" |
text | string | Optional | "Announcement" |
href | string | Optional | "" |
actionLabel | string | Optional | "Learn more" |
variant | string | Optional | "brand" |
Slots
This component does not declare a slot.
Events
This component does not declare a custom event.
Source contract
Installed source: components/Banner.wrn
component Banner {
props {
class = ""
text = "Announcement"
href = ""
actionLabel = "Learn more"
variant = "brand"
}
view {
<aside class="px-4 py-3 text-center text-sm font-medium {variant === 'warning' ? 'bg-amber-400 text-amber-950' : 'bg-violet-600 text-white'} {class}">
<span>{text}</span>
<a data-show="href" href="{href}" class="ml-2 underline underline-offset-4">{actionLabel} →</a>
</aside>
}
}