Skip to content
esc

Banner

Feedbackshadcn/ui

An inline message inside the page: a server error on a form, a pending verification, a successful change.

When to use

  • Put form-level errors ('Wrong email or password') in a destructive Banner above the fields.
  • Start with what happened, then what to do.
  • Don't use a Banner for a field error; use FieldError.
  • Don't show more than one Banner per area.

Accessibility

Role
alert (destructive, warning) or status
Keyboard
Not focusable; actions inside are.
Notes
Role is set from the variant, so screen readers announce errors right away.

Props

  • variant= 'info'

    'info' | 'success' | 'warning' | 'destructive' | 'neutral'

    Meaning and tint.

Prompt for your agent

Use the UnbuiltUI Banner. Call unbuilt_get_component("Banner") first and follow its spec: variants, states, usage rules and accessibility.

unbuilt_get_component returns

5 variants1 state1 prop4 usage rules2 a11y notes12 tokens1 example

Add it with shadcn

$npx shadcn add https://unbuiltui.com/r/banner.json

Tokens · 12

accent.subtleaccent.defaultsuccess.subtlesuccess.defaultwarning.subtlewarning.defaultdanger.subtledanger.defaultbg.subtlefg.defaultfg.mutedradius.md