Toast
feedbackA succinct message that is displayed temporarily, with support for actions.
Preview
Installation
npm install @launchapp/design-systemImport
import { Toaster, useToast } from "@launchapp/design-system";Examples
Toast Usage
function ToastExample() { const { toast } = useToast(); return ( <> <Toaster /> <Button onClick={() => toast({ title: "Scheduled", description: "Monday, January 3rd at 6:00pm" })} > Show Toast </Button> </> );}Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "destructive" | "default" | The visual style of the toast. |
title | string | — | Toast title. |
description | string | — | Toast description. |
duration | number | 5000 | Auto-dismiss duration in ms. |
action | ToastActionElement | — | Optional action button element. |