Skip to content

    Browse components

    Toast

    Toast system (provider + useToast hook) with variants, actions, in-place updates, a collapsed stack that fans out on hover, swipe to dismiss and a pausable countdown bar.

    Open
    Customize
    top-left
    top-center
    top-right
    bottom-left
    bottom-center
    bottom-right

    Installation

    npx shadcn@latest add @glint-ui/toast

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/toast.json

    Usage

    import { Toast } from "@/components/ui/toast";
    
    <ToastProvider placement="bottom-right">
      <App />
    </ToastProvider>
    
    // inside a component
    const { toast, dismiss } = useToast();
    toast({ title: "Saved", variant: "success" });
    const id = toast({ title: "Uploading", variant: "loading" });
    toast({ id, title: "Uploaded", variant: "success" }); // update in place

    Props

    PropTypeDefaultDescription
    placement"top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right""bottom-right"Corner or edge of the stack.
    durationnumber4000Default auto-dismiss time (ms).
    expandbooleanfalseAlways show the full list instead of a stack.
    position"fixed" | "absolute""fixed"fixed = viewport; absolute = nearest positioned parent.
    childrenReactNode—Your app; call useToast() anywhere inside.
    classNamestring—Extra classes for the root element.