43 Pro components and page blocks

Get Pro

Toast

New

Preview

Customize

Bottom right
Visible toasts3
Duration4000ms
Gap12px

Usage

import { Toaster } from "@/components/uibrik/toast/toast";

<Toaster />

Installation

npx shadcn@latest add https://uibrik.com/r/toast.json
Adds the files to components/uibrik/toast and installs motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/toast.

Props

Toaster
position
Type "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right"
"bottom-right"
Corner or edge the toasts gather in.
expand
Type boolean
false
Keep the stack fanned out instead of only on hover.
visibleToasts
Type number
3
Toasts drawn at once.
duration
Type number
4000
Default time on screen. Hovering pauses it.
gap
Type number
12
Space between toasts when fanned out.
closeButton
Type boolean
false
Show a close button on each toast.
toast(title, options?)
Type function
–
Shows a toast and returns its id. Also toast.success, .error, .info, .loading, .promise(promise, { loading, success, error }) and .dismiss(id?).
options.description
Type ReactNode
–
A second line under the title.
options.action
Type { label: string; onClick: () => void }
–
One button, e.g. Undo. Pressing it also dismisses the toast.
options.duration
Type number
–
Milliseconds on screen for this toast. Infinity keeps it until dismissed.
options.id
Type number | string
–
Reuse an id to update that toast in place.
className
Type string
–
Classes for the Toaster's region.