Bus UI Status

ErrorBanner shows recoverable errors.

Use ErrorBanner when a page can explain an error and optionally offer retry or dismiss actions.

Public API

Functionui.ErrorBanner
Propsui.ErrorBannerProps
Use forRecoverable page errors with optional retry and dismiss controls.

Example

Loading ErrorBanner demo...

Go API

import ui "github.com/busdk/bus-ui/pkg/ui"

banner, err := ui.ErrorBanner(ui.ErrorBannerProps{
  Message:    "Provider is temporarily unavailable.",
  RetryLabel: "Retry",
  Retry:      ui.ControlProps{Action: "retry-provider"},
})

In .gx source, wrap the error banner so the retry control remains typed Go while the message is authored in markup.

In .gx source, the error banner is alert markup with the message supplied by props.

.gx source

package statusui

import gx "github.com/busdk/bus-gx/pkg/gx"

type ImportErrorProps struct {
  Message string
}

func ImportError(props ImportErrorProps) gx.Node {
  return <section class="error-banner" role="alert">
  <p><Text value={props.Message}></Text></p>
</section>
}

var banner = <ImportError message={"The file could not be imported."}></ImportError>