Dismissible
flx/banner-03FreeBlock
A close button hides the banner with a restore link.
Install it
npx shadcn@latest add https://ui.flexnative.com/r/banner-03.jsonSource
1'use client'23import { useState } from 'react'4import { Sparkles, X } from 'lucide-react'56import { Button } from '@/components/ui/button'78export function Banner03() {9 const [open, setOpen] = useState(true)1011 if (!open) {12 return (13 <button14 type="button"15 onClick={() => setOpen(true)}16 className="text-muted-foreground hover:text-foreground text-sm underline-offset-4 hover:underline"17 >18 Show banner again19 </button>20 )21 }2223 return (24 <div className="relative flex w-full items-center gap-3 rounded-lg border bg-card px-4 py-3 pr-12 text-sm shadow-sm">25 <span className="bg-primary/10 text-primary flex size-8 shrink-0 items-center justify-center rounded-full">26 <Sparkles className="size-4" />27 </span>28 <p className="text-muted-foreground">29 <span className="text-foreground font-medium">What's new.</span>{' '}30 We've refreshed the editor with faster autosave.31 </p>32 <Button33 variant="ghost"34 size="icon-sm"35 onClick={() => setOpen(false)}36 aria-label="Dismiss banner"37 className="text-muted-foreground absolute top-1/2 right-2 -translate-y-1/2"38 >39 <X />40 </Button>41 </div>42 )43}
What it pulls in
Other registry items
Files it writes
More from flx
All 446 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Basicaccordion-01 | flx | Blocks | Free | no deps | |
| Multipleaccordion-02 | flx | Blocks | Free | no deps | |
| With iconsaccordion-03 | flx | Blocks | Free | no deps | |
| FAQaccordion-04 | flx | Blocks | Free | no deps | |
| Separated cardsaccordion-05 | flx | Blocks | Free | no deps | |
| Plus / minus iconaccordion-06 | flx | Blocks | Free | 1 dep | |
| Left chevronaccordion-07 | flx | Blocks | Free | 1 dep | |
| Rich contentaccordion-09 | flx | Blocks | Free | no deps |
