Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

Offline

A strip under the top bar while the browser is offline. The content below stays readable; the banner says when it last loaded. Toggle the browser's offline mode to see it, and the back-online message.

Offline with a time and Check again
Show code
<app-offline-banner loaded-at="23:12" offline="true" check-again="true"></app-offline-banner>
Offline, no time
Show code
<app-offline-banner offline="true"></app-offline-banner>
Follow the browser
Show code
<app-offline-banner></app-offline-banner>

Guidance

What to do, and what to avoid.

Use it when

  • The connection drops while a person works on a page that shows content already loaded.
  • The page should say how old the content on screen is.

Reach for something else when

  • A message after a save or an action that disappears on its own. → toast
  • One part of the page failed to load and the rest still works. → AppResultBlock

Say when the content last loaded

Do

The time tells a person how old the figures are, so they know whether to trust them.

Avoid

Without a time a person cannot tell how old the figures on screen are.

Reference

Try every prop, read the full list, and check keyboard and screen reader behaviour.

React, generated from the controls
<AppOfflineBanner loadedAt="23:12" onCheckAgain={() => refetch()} />
Razor, the same props
<app-offline-banner loaded-at="23:12" check-again="true"></app-offline-banner>

3 props. The 2 most used come first.

Used on most screens 2 props

PropTypeDefaultDescription
offlinedefault follows the browser bool follows the browser Shows the banner while true, hides it while false. Unset, the banner follows the browser's connection and shows the back-online line for a few seconds.
loaded-atdefault none string none When the content on the page last loaded, as the screen formats it (for example 23:12).

Less common 1 props

PropTypeDefaultDescription
check-againdefault false bool false Draws the Check again button. A press is reported as a wui:offline-banner:check-again event on the element.

Screen reader

2 notes
  • The banner is a status region, so a screen reader announces going offline and coming back online.
  • Check again is a native button with its own name and focus ring.

Do and avoid

1 pairs

Say when the content last loaded

Do

The time tells a person how old the figures are, so they know whether to trust them.

Avoid

Without a time a person cannot tell how old the figures on screen are.