SYS:ONLINE● ACTIVE
THEME
GITHUBv0.1.0

TOAST

Non-blocking notification built on Radix UI. Slides in from bottom-right. Four semantic variants. Managed via useToast hook with auto-dismiss.

DEPS:@radix-ui/react-toast

PREVIEW

    INSTALLATION

    BASH
    npx shadcn@latest add @scificn/toast

    Then copy src/ui/toast/toast.tsx and src/ui/toast/use-toast.ts into your project.

    HOOK USAGE

    TSX
    import { useToast } from '@/ui/toast/use-toast'
    
    export function MyComponent() {
      const { toasts, toast, dismiss } = useToast()
    
      function handleAlert() {
        toast({
          title: 'SHIELD FAILURE',
          description: 'Sector 7 shields offline.',
          variant: 'CRITICAL',
          duration: 6000,    // ms before auto-dismiss (default: 4000)
        })
      }
    
      return <button onClick={handleAlert}>TRIGGER</button>
    }

    VARIANTS

    variant="STATUS"
    variant="WARNING"
    variant="CRITICAL"
    variant="INFO"

    PROPS

    PROPTYPEDEFAULTDESCRIPTION
    variantSTATUS | WARNING | CRITICAL | INFOSTATUSControls left border color, glow, and prefix symbol.
    openbooleanControlled open state (used by ToastProvider internally).
    onOpenChange(open: boolean) => voidCallback when open state changes.
    durationnumber (on toast() call)4000Auto-dismiss delay in milliseconds.