NK

Search

Search pages, posts, and components

All components

Toast

Feedback

A toast that slides in and can be dismissed.

Changes saved

Your draft is up to date.

Installation

Add it with the shadcn CLI:

$pnpm dlx shadcn@latest add https://nawalkattel.com.np/r/toast.json
Or install manually
  1. 1. Install dependencies

    pnpm add motion clsx tailwind-merge lucide-react
  2. 2. Copy the component source into components/library/toast.tsx

Props

PropTypeDefaultDescription
titlestring - Headline text.
descriptionstring - Optional supporting line.
iconReactNode - Overrides the default check icon.

Accessibility

  • The dismiss button carries an aria-label.
  • Pair with an aria-live region when toasts appear programmatically.
  • Icon is decorative; the title always carries the message.

Dependencies

motionclsxtailwind-mergelucide-react