sonner
ora-ui/sonnerFreeComponent
ora-ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by ora-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ora-ui.com/r/sonner.jsonSource
1'use client';23import { useTheme } from 'next-themes';4import { Toaster as Sonner, type ToasterProps } from 'sonner';5import {6 ArrowPathIcon,7 CheckCircleIcon,8 ExclamationTriangleIcon,9 InformationCircleIcon,10 XCircleIcon,11} from '@heroicons/react/16/solid';1213const Toaster = ({ ...props }: ToasterProps) => {14 const { theme = 'system' } = useTheme();1516 return (17 <Sonner18 theme={theme as ToasterProps['theme']}19 className="toaster group"20 icons={{21 success: <CheckCircleIcon className="size-4" />,22 info: <InformationCircleIcon className="size-4" />,23 warning: <ExclamationTriangleIcon className="size-4" />,24 error: <XCircleIcon className="size-4" />,25 loading: <ArrowPathIcon className="size-4 animate-spin" />,26 }}27 style={28 {29 '--normal-bg': 'var(--popover)',30 '--normal-text': 'var(--popover-foreground)',31 '--normal-border': 'var(--border)',32 '--border-radius': 'var(--radius)',33 } as React.CSSProperties34 }35 toastOptions={{36 classNames: {37 toast: 'cn-toast',38 },39 }}40 {...props}41 />42 );43};4445export { Toaster };
What it pulls in
npm packages
Files it writes
More from ora-ui
All 31 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | ora-ui | Components | Free | 2 deps | |
| alert-dialogalert-dialog | ora-ui | Components | Free | 1 dep | |
| avataravatar | ora-ui | Components | Free | 1 dep | |
| avatar-groupavatar-group | ora-ui | Components | Free | no deps | |
| badgebadge | ora-ui | Components | Free | 2 deps | |
| buttonbutton | ora-ui | Components | Free | 2 deps | |
| button-groupbutton-group | ora-ui | Components | Free | 2 deps | |
| checkboxcheckbox | ora-ui | Components | Free | 3 deps |
