CnBannerWidget
A notice for dashboards and pages. It renders a themed note card with a severity, a text, an optional click-through route and an optional visibleWhen condition. With layout: "attention" it renders an attention card: a card with a severity edge, a kicker, a title, a reason line and actions.
The widget registers itself as the banner dashboard widget type, so a manifest places it with widgetKey: "banner". It is also a named export, for an app component that draws the card itself and passes the props directly:
import { CnBannerWidget } from '@conduction/nextcloud-vue'
Before this export existed, a named import resolved to undefined. Vue then rendered an unknown <cnbannerwidget> element and the grid kept an empty cell for it. An app that cannot import it yet can read the same component from the widget registry with getWidgetTypeEntry('banner').renderer.
For the manifest keys and the attention card see the dashboard widget catalog.
Props
| Prop | Type | Description |
|---|---|---|
variant | 'info' | 'warning' | 'error' | 'success' | The severity. Empty falls back to content, then info. |
text | string | The banner text. Empty falls back to content. |
lead | string | A bold lead before the text; {value} is filled like in text, and it goes through the app's translate (as text does). Empty falls back to content. |
icon | string | A named icon (AccountPlus, ...) drawn before the text instead of the variant's glyph. Empty falls back to content. Under the board look the first of actions is drawn as a link at the end of the line. |
visibleWhen | object | null | The visibility condition. null shows the banner always. |
route | string | object | null | A route name or location. When set, the text is a link. |
layout | '' | 'banner' | 'attention' | The note card (default) or the attention card. |
kicker | string | Attention card: the label above the title. |
title | string | Attention card: the title. Falls back to text. |
reason | string | Attention card: the line that says why it needs attention. |
actions | Array | Attention card: the actions. |
maxActions | number | null | Attention card: the most actions shown. |
stacked | boolean | Attention card: the actions under the text, with a 16px title. |
content | object | The stored content blob; flat props win on collision. |
conditionOutcome | object | null | A verdict a host already evaluated, so the banner does not fetch again. Its row is the first row of an ordered visibleWhen.source, the card's subject ({subject.title} in the texts, @subject.id in an action route). |
Events
| Event | Payload | Description |
|---|---|---|
action | { id, label, index } | An attention-card action with neither route nor href was clicked. |
Reference (auto-generated)
OpenRegister reliance
light: this component touches OpenRegister lightly. 0 direct references, 3 files reached through imports.
See the reliance overview for the filterable list.
Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
variant | string | '' | Banner severity variant: info | warning | error (plus success for completeness — NcNoteCard's set). Empty falls back to the content blob, then info. | |
text | string | '' | Pre-translated banner text. Empty falls back to the content blob. | |
lead | string | '' | A bold lead in front of the text ("2 aanmeldingen wachten op goedkeuring." before the rest of the sentence). {value} is replaced like in text, and it goes through the app's translate. Empty falls back to the content blob. | |
icon | string | '' | A named icon (AccountPlus, AlertOutline, ...) drawn before the text instead of the variant's own glyph. Empty falls back to the content blob, then to the variant glyph. | |
visibleWhen | union | null | Optional visibility condition. Shape: { endpoint?, source?, field?, op?, value } — exactly one of endpoint (a same-origin URL returning JSON) or source ({ register, schema, filter? }, an OpenRegister object query whose filter supports the shared @-token grammar). field is a dot-path into the response (for a source, into the first result; omit it — or use @total — to compare the collection total). op is eq | neq | gt | gte | lt | lte (default eq); value is the literal right-hand side. null (the default) shows the banner unconditionally. | |
route | union | null | Optional click-through route: a vue-router route NAME (string) or a full location object. When set, the banner text is a link to that route. null renders static text. | |
layout | string | '' | How the banner renders: banner (the note card, default) or attention (a card with a severity edge, kicker, title, reason and up to two actions). Empty falls back to the content blob, then banner. | |
kicker | string | '' | Attention card: the small label above the title ("First today"). | |
title | string | '' | Attention card: the title. Falls back to text when empty. | |
reason | string | '' | Attention card: the line under the title that says why this needs attention. {value} is replaced like in text. | |
actions | union | null | Attention card: its actions, two at most (four under the board look, or maxActions). Each is { label, route?, href?, primary?, id? }: route is a route name or location, href an URL. An action with neither renders a button that emits action. The first action is the primary one unless one sets primary: true. | |
maxActions | number | null | Attention card: how many actions it shows at most. Null takes the default: two, four under the board look. | |
stacked | boolean | false | Attention card: stack the actions under the text instead of beside it, the "Begin hier" card of PqMijnWerk (16px title, the action under the reason). Falls back to the content blob. | |
content | object | \{\} | Stored content blob (CnDashboardPage registry branch) carrying the same keys as the flat props: { variant, text, visibleWhen, route, layout, kicker, title, reason, actions }. Explicit flat props win on collision. | |
conditionOutcome | union | null | Pre-evaluated visibleWhen outcome { met, value }, injected by a host that already ran the predicate (CnDashboardPage evaluates it to know whether to collapse the banner's grid cell). When present, the banner renders from this verdict instead of fetching again — no duplicate request and no hidden-until-self-evaluated flash — and value feeds the {value} text placeholder. null (the default) keeps the banner self-evaluating. A host whose request failed passes { met: false, value: null, failed: true, reason }, and an attention card then says it could not check. |
Events
| Name | Payload | Description |
|---|---|---|
action | — | Emitted when an attention-card action without a route or href is clicked, so the host can run it. |