Sonner
muffled-ui-registry/sonnerFreeComponent
Toast notifications on ink and paper. Hairline borders, no shadows.
Live preview
live · rendered by the registry
Rendered by muffled-ui-registry on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ui.muffled.studio/r/sonner.jsonSource
1import { Toaster as Sonner, type ToasterProps } from "sonner"2import {3 CircleCheckIcon,4 InfoIcon,5 OctagonXIcon,6 TriangleAlertIcon,7} from "lucide-react"89import { cn } from "@/registry/lib/surface"10import { Spinner } from "@/registry/ui/spinner"1112const Toaster = ({ theme = "light", ...props }: ToasterProps) => {13 return (14 <Sonner15 theme={theme}16 className="toaster group"17 icons={{18 success: <CircleCheckIcon className="size-4" />,19 info: <InfoIcon className="size-4" />,20 warning: <TriangleAlertIcon className="size-4" />,21 error: <OctagonXIcon className="size-4" />,22 loading: <Spinner />,23 }}24 style={25 {26 "--normal-bg": "var(--popover)",27 "--normal-text": "var(--popover-foreground)",28 "--normal-border": "var(--border)",29 "--border-radius": "var(--radius)",30 } as React.CSSProperties31 }32 toastOptions={{33 classNames: {34 toast: cn(35 "group/toast pointer-events-auto w-full rounded-md border border-border bg-popover p-4 font-sans text-sm text-popover-foreground shadow-none"36 ),37 title: "font-sans text-sm font-medium text-foreground",38 description: "font-sans text-sm text-muted-foreground",39 actionButton: cn(40 "inline-flex h-7 shrink-0 items-center justify-center rounded-md border border-border bg-background px-2.5 font-sans text-sm font-medium text-foreground transition-opacity duration-[var(--d-drift)] ease-[var(--ease-drift)] hover:opacity-60 active:opacity-40"41 ),42 cancelButton: cn(43 "inline-flex h-7 shrink-0 items-center justify-center rounded-md border border-border bg-background px-2.5 font-sans text-sm font-medium text-foreground transition-opacity duration-[var(--d-drift)] ease-[var(--ease-drift)] hover:opacity-60 active:opacity-40"44 ),45 closeButton: cn(46 "absolute right-2 top-2 rounded-md border border-transparent text-foreground transition-opacity duration-[var(--d-drift)] ease-[var(--ease-drift)] hover:opacity-60 active:opacity-40"47 ),48 },49 }}50 {...props}51 />52 )53}5455export { Toaster }
What it pulls in
npm packages
Other registry items
Files it writes
More from muffled-ui-registry
All 55 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | muffled-ui-registry | Components | Free | 2 deps | |
| Alertalert | muffled-ui-registry | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | muffled-ui-registry | Components | Free | 1 dep | |
| Avataravatar | muffled-ui-registry | Components | Free | 1 dep | |
| Badgebadge | muffled-ui-registry | Components | Free | 2 deps | |
| Breadcrumbbreadcrumb | muffled-ui-registry | Components | Free | 2 deps | |
| Buttonbutton | muffled-ui-registry | Components | Free | 2 deps | |
| Button Groupbutton-group | muffled-ui-registry | Components | Free | 2 deps |
