Files
ui-kit/src/components/toast.tsx
T
Jason Stedwell 822d8e41e6
ci / build-and-design (push) Failing after 13s
visual upgrade
2026-07-23 04:23:19 -05:00

27 lines
818 B
TypeScript
Executable File

import { Toaster as Sonner, toast } from "sonner";
import { useOptionalTheme } from "../lib/theme";
/** Pre-themed sonner Toaster. Drop <Toaster /> once near your app root. */
export const Toaster = ({ toastOptions, ...props }: React.ComponentProps<typeof Sonner>) => {
const theme = useOptionalTheme();
return (
<Sonner
theme={theme?.resolvedTheme ?? "system"}
position="bottom-right"
toastOptions={{
...toastOptions,
classNames: {
toast: "!bg-surface !border-border !text-text !rounded-lg !shadow-lg",
description: "!text-muted",
actionButton: "!bg-brand !text-brand-foreground",
cancelButton: "!bg-surface-2 !text-muted",
...toastOptions?.classNames,
},
}}
{...props}
/>
);
};
export { toast };