banner-info
lyse/banner-infoFreeComponent
lyse publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by lyse on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ui.getlyse.com/r/banner-info.jsonSource
1import * as React from "react"2import { cva, type VariantProps } from "class-variance-authority"3import {4 Sparkles,5 Info,6 TriangleAlert,7 CircleCheck,8} from "lucide-react"910import { cn } from "@/lib/utils"11import "./banner-info.css"1213const bannerInfoVariants = cva(14 "flex items-start gap-[var(--layout-gap-md)] rounded-[var(--layout-radius-xl)] p-[var(--layout-padding-lg)] text-content-note [&_svg]:shrink-0 [&_svg]:h-[var(--layout-size-sm)] [&_svg]:w-[var(--layout-size-sm)]",15 {16 variants: {17 variant: {18 brand: "banner-info-brand",19 neutral: "banner-info-neutral",20 danger: "banner-info-danger",21 success: "banner-info-success",22 warning: "banner-info-warning",23 },24 },25 defaultVariants: {26 variant: "neutral",27 },28 }29)3031const variantIcons = {32 brand: Sparkles,33 neutral: Info,34 danger: TriangleAlert,35 success: CircleCheck,36 warning: TriangleAlert,37} as const3839function BannerInfo({40 className,41 variant = "neutral",42 withIcon = true,43 children,44 ...props45}: React.ComponentProps<"div"> &46 VariantProps<typeof bannerInfoVariants> & {47 withIcon?: boolean48 }) {49 const Icon = variant ? variantIcons[variant] : variantIcons.neutral5051 return (52 <div53 data-slot="banner-info"54 role="status"55 className={cn(bannerInfoVariants({ variant, className }))}56 {...props}57 >58 {withIcon && <Icon aria-hidden="true" />}59 <div className="flex-1 min-w-0">{children}</div>60 </div>61 )62}6364export { BannerInfo, bannerInfoVariants }
What it pulls in
npm packages
Other registry items
Files it writes
More from lyse
All 33 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| action-cardaction-card | lyse | Components | Free | no deps · 2 files | |
| alertalert | lyse | Components | Free | 2 deps · 2 files | |
| alert-dialogalert-dialog | lyse | Components | Free | 2 deps · 2 files | |
| avataravatar | lyse | Components | Free | 3 deps · 2 files | |
| badgebadge | lyse | Components | Free | 1 dep · 2 files | |
| breadcrumbbreadcrumb | lyse | Components | Free | 2 deps · 2 files | |
| buttonbutton | lyse | Components | Free | 2 deps · 2 files | |
| callout-cardcallout-card | lyse | Components | Free | 1 dep · 2 files |
