Toast

Radix toast with Alert-like sketch chrome. Wrap the tree in ToastProvider for stacking, auto-dismiss, and the live region.

    <Toast variant="success" title="Saved" roughness={1.5}>
      The sketch is in the notebook.
    </Toast>

    CLI install

    npx doodleui-react add toast

    Usage

    import { Toast, ToastProvider, Button } from "doodleui-react";
    
    <ToastProvider>
      <Button onClick={() => setOpen(true)}>Show toast</Button>
      <Toast open={open} onOpenChange={setOpen} variant="success" title="Saved">
        The sketch is in the notebook.
      </Toast>
    </ToastProvider>
    

    ARIA live region, duration, and swipe come from Radix. Entry slides in with a short sketchy settle wobble and reverses on exit. Set animate={false} for an instant card.

    Props

    PropTypeDefaultNotes
    variant"info" | "warning" | "error" | "success""info"Sets stroke and wash color, matching Alert.
    titleReactNodeundefinedBold first line.
    open / onOpenChangeboolean / (open: boolean) => voiduncontrolledRadix toast visibility. Auto-dismiss comes from ToastProvider duration.
    durationnumberproviderOverride auto-dismiss for this toast, in milliseconds.
    animatebooleantrueSlide-in with a sketchy settle wobble; reverse on exit. Overrides DoodleUIProvider. Reduced motion disables this unless the provider set forceAnimate.
    roughnessnumber1.5How wobbly the stroke is. 0 is almost geometric. 3+ is messy.
    seednumberprovider / randomLocks the sketch. Omit to follow SketchSeedProvider (Shuffle) or a mount-time random seed.
    sketchColorstring#1f1d1aStroke color. Also tints primary/accent fills where relevant.
    classNamestringundefinedPassed through to the root element.
    styleCSSPropertiesundefinedPassed through to the root element.