Components

Toast

Provider-based toast notification system. Trigger toasts from anywhere with imperative API.

import{ Toast }from"oks-ui"
6 positionsAuto-dismissPromise support7 variantsCustom duration

Basic

Wrap your app in ToastProvider, then call toast() anywhere.

Toast requires ToastProvider. Use toast() or showToast() to trigger.

Interactive Playground

Controls

Preview

Generated Code

<ToastProvider>
  <App />
</ToastProvider>

// Trigger from anywhere:
toast.success("Saved successfully!");
toast.error("Something went wrong.");

Props

position"top-right"

"top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right"

Toast stack position.

maxToasts5

number

Maximum visible toasts.

defaultDuration4000

number

Default toast display duration (ms).

disableAnimationfalse

boolean

Disable toast animations.

toastOffset12

number

Offset between stacked toasts.