Banner

A banner is a full-width component that can be used to show a message and action to the user.

Installation

npx love-ui@latest add banner

Usage

import { Banner, BannerIcon, BannerTitle, BannerAction, BannerClose } from "@/components/banner"
<Banner>
  <BannerIcon>
    <AlertCircle />
  </BannerIcon>
  <BannerTitle>Important update available</BannerTitle>
  <BannerAction onClick={() => console.log("Update")}>Update now</BannerAction>
  <BannerClose />
</Banner>

Features

  • Controlled and uncontrolled visibility state
  • Customizable close handler
  • Optional inset variant with rounded corners
  • Composable API with Icon, Title, Action and Close components
  • Customizable via className prop
  • Adapts to primary color tokens

Examples

Inset

Different primary colors