Banner

Inline notice banner in accent, warning or danger tones, with a status role, a slot for an action button and an optional dismiss icon on the right.

src/registry/ui/banner.tsx/r/banner.json
5 days left in your trial.

Accent

Degraded API performance in us-east.

Warning

Installation#

bash
npx shadcn@latest add @minidev/banner

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/banner.json

Usage#

tsx
import { Banner } from "@/components/ui/banner"

export function Example() {
  return (
    <Banner className="w-full max-w-xl" action={<Button size="sm" variant="outline">Upgrade</Button>}>Your trial ends in 5 days.</Banner>
  )
}

API reference#

Banner props
PropTypeDefault
children*React.ReactNode-
tone"accent" | "warning" | "danger""accent"
classNamestring-
actionReact.ReactNode-
onDismiss() => void-

* required

Dependencies#

npm

lucide-react

Built from

Examples#

All alerts, toasts and empty states

Learn more