bearnie

Toast

Temporary notification messages.

Installation

npx bearnie add toast
npx bearnie add toast

Usage

import { Toaster } from "@/components/ui/toast"
toast("Event has been created.")

Examples

With title and description

Success

Error

Warning

Info

With action

Anatomy

  • Toaster - The container that renders toasts (add once to layout)

Props

Toaster

PropTypeDefaultDescription
positiontop-left | top-center | top-right | bottom-left | bottom-center | bottom-rightbottom-rightToast position
classstring-Additional CSS classes

toast() function

OptionTypeDefaultDescription
titlestring-Toast heading
descriptionstring-Toast message
typedefault | success | error | warning | infodefaultToast variant
durationnumber4000Auto-dismiss time (ms)
actionobject-Action button config