On this page
@addTagHelper *, Webority.Ui.RazorTones
Pick the tone by what the message means: info for notices, success for updates, danger for serious problems.
A leading icon
Add an icon to reinforce the message at a glance, using a library icon name.
With an action
Put a link or a button in the banner so the reader can act on it straight away.
Dismissible
Let the reader clear a notice they have seen, but not a condition that should keep showing.
Every option
Every value of every prop, one cell each.
content
plain messagemessage with an inline action linklong content wraps within the bannertone: all five
tone="info" (default)tone="success"tone="warning"tone="danger"tone="neutral"icon
icon omitted (default): no iconicon="alert-triangle": glyph nameicon={<svg/>}: React only, Razor takes a glyph namedismissible
dismissible omitted (default): no close buttondismissible="true": shows a × the user can clickdismissible="true" with icon and tone combinedaction
app-banner-action omitted (default)app-banner-action: a button at the right edgeonClose
onClose: React only, Razor has no callbackclassName
className: React only, Razor has no className propdismissLabel
dismiss-label="Dismiss" (default)dismiss-label="Fermer": replaces the English textGuidance
What to do, and what to avoid.
Use it when
- The message applies to the whole screen or app, not one section of it.
- It should stay visible until the user dismisses it or the condition it reports ends.
- It is the kind of thing every user of the page needs to see: maintenance, a trial ending, a new version.
Reach for something else when
- The message is about one section or form on the page. → AppAlert
- The feedback is brief and self-dismissing, such as Saved or Copied. → toast
- You are explaining how something works, not reporting a state. → AppAlert
Banner only for page-wide notices
A page-wide, time-bound notice every visitor needs to see, with a tone that matches its urgency.
A field-level validation message belongs next to the field, not full-bleed across the page. That is AppAlert's job.
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
6 props. The 4 most used come first.
Used on most screens 4 props
| Prop | Type | Default | Description |
|---|---|---|---|
| tonedefault info | info | success | warning | danger | neutral | info | The colour and intent of the banner. |
| icondefault - | string | - | A leading icon: a library icon name or any node. |
| dismissibledefault false | bool | false | Shows a close button that removes the banner. |
| dismiss-labeldefault Dismiss | string | Dismiss | Replaces the built-in English text, for other languages. |
Less common 2 props
| Prop | Type | Default | Description |
|---|---|---|---|
| (content)default - | markup | - | The banner message; may include an inline action link. |
| onClosedefault - | - | - | Razor has no server-side dismiss callback (the dismiss button is a client-side DOM removal). |
Screen reader
2 notes- The banner has role status, so a screen reader announces it politely when it appears.
- The close button, shown with dismissible, is named Dismiss.
Do and avoid
1 pairsBanner only for page-wide notices
A page-wide, time-bound notice every visitor needs to see, with a tone that matches its urgency.
A field-level validation message belongs next to the field, not full-bleed across the page. That is AppAlert's job.