Skip to content

    Browse components

    Fling Toast

    Stacked toasts that fan out on hover, pause their progress timers while you read, and fling away when swiped sideways.

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

    Installation

    npx shadcn@latest add @glint-ui/fling-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/fling-toast.json

    Usage

    import { FlingToast } from "@/components/ui/fling-toast";
    
    const { toasts, push, dismiss } = useSwipeToast();
    
    <button onClick={() => push({ title: "Saved", tone: "success" })}>Save</button>
    <FlingToast toasts={toasts} onDismiss={dismiss} position="bottom-right" />

    Props

    PropTypeDefaultDescription
    position"top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right""bottom-right"Corner the stack is anchored to.
    strategy"absolute" | "fixed""absolute"absolute stays inside the nearest positioned parent; fixed uses the viewport.
    durationnumber5000Ms before auto-dismiss. 0 = until swiped.
    visiblenumber3Toasts peeking out of the collapsed stack.
    gapnumber10Px between toasts when expanded.
    toastsReactNode—Array of { id, title, description?, tone? }. useSwipeToast() manages one for you.
    onDismissReactNode—Called with the id when a toast is swiped, closed or times out.
    classNamestring—Extra classes for the root element.