Glass Sonner
washiveil/glass-sonnerFreeComponent
Toasts as small veils — sonner styled on the washi glass registers.
Install it
npx shadcn@latest add https://washiveil.alexchih.com/r/glass-sonner.jsonSource
1'use client'23import * as React from 'react'4import { Toaster as Sonner, toast } from 'sonner'56type GlassToasterProps = React.ComponentProps<typeof Sonner>78function GlassToaster({ ...props }: GlassToasterProps) {9 const [theme, setTheme] = React.useState<'light' | 'dark'>('light')1011 React.useEffect(() => {12 const root = document.documentElement13 const update = () => {14 setTheme(root.classList.contains('dark') ? 'dark' : 'light')15 }16 update()17 const observer = new MutationObserver(update)18 observer.observe(root, { attributes: true, attributeFilter: ['class'] })19 return () => observer.disconnect()20 }, [])2122 return (23 <Sonner24 theme={theme}25 className="toaster group"26 toastOptions={{27 classNames: {28 toast:29 'group toast group-[.toaster]:rounded-2xl group-[.toaster]:border-glass-edge group-[.toaster]:bg-glass-stronger group-[.toaster]:backdrop-blur-2xl group-[.toaster]:backdrop-saturate-150 group-[.toaster]:text-foreground group-[.toaster]:shadow-[0_16px_48px_rgba(28,25,20,0.12)]',30 description: 'group-[.toast]:text-muted-foreground',31 actionButton: 'group-[.toast]:bg-ruri group-[.toast]:text-white dark:group-[.toast]:bg-ruri-soft dark:group-[.toast]:text-deep',32 cancelButton: 'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground',33 },34 }}35 {...props}36 />37 )38}3940export { GlassToaster, toast }
What it pulls in
npm packages
Other registry items
Files it writes
More from washiveil
All 58 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Ambient Fieldambient-field | washiveil | Components | Free | no deps | |
| Chipchip | washiveil | Components | Free | 1 dep | |
| Code Badgecode-badge | washiveil | Components | Free | no deps | |
| Glass Accordionglass-accordion | washiveil | Components | Free | 2 deps | |
| Glass Alertglass-alert | washiveil | Components | Free | 1 dep | |
| Glass Alert Dialogglass-alert-dialog | washiveil | Components | Free | 1 dep | |
| Glass Aspect Ratioglass-aspect-ratio | washiveil | Components | Free | 1 dep | |
| Glass Avatarglass-avatar | washiveil | Components | Free | 1 dep |
