Components
Toast

Toast

The Toast component provides you with popup notifications.

Live Examples

Storybook: components-toast--default
Storybook: components-toast--success
Storybook: components-toast--with-action

Examples

import { Toast, ToastAction, ToastDescription, ToastProvider, ToastTitle, ToastViewport } from '@nostromo/ui-core'
 
export default function ToastExample() {
  return (
    <ToastProvider>
      <Toast>
        <ToastTitle>Success!</ToastTitle>
        <ToastDescription>Your action was completed.</ToastDescription>
        <ToastAction altText="Undo">Undo</ToastAction>
      </Toast>
      <ToastViewport />
    </ToastProvider>
  )
}

Props

PropTypeDefaultDescription
variant"default" | "destructive""default"Toast variant
durationnumber5000Toast duration in ms