GitHub 560+

Banner

A full-width container for important messages or announcements.

Installation

npx shadcn@latest add @fulldev/banner

Usage

import { Banner, BannerContainer } from "@/components/ui/banner"
<Banner>
  <BannerContainer>
    <p class="text-sm font-medium">Banner Title</p>
    <p class="text-sm opacity-90">Banner Description</p>
  </BannerContainer>
</Banner>

BannerContainer renders a close button by default. Set showClose={false} to hide it.

<Banner>
  <BannerContainer showClose={false}>
    <p class="text-sm font-medium">Banner Title</p>
    <p class="text-sm opacity-90">Banner Description</p>
  </BannerContainer>
</Banner>

Examples

Notes

  • Use variant="default" for full-width announcements.
  • Use variant="floating" for inset announcement bars.

API Reference

See the GitHub source code for more information on props.