๐ŸŽฏ Nexus teaches Next.js from foundations to professional systemsโ€ขโšก App Router, React 19, and Tailwind v4 in one learning pathโ€ข๐Ÿงฉ Inspect real components, layouts, and reusable patternsโ€ข๐Ÿ› ๏ธ Build production discipline, not just polished demosโ€ข๐Ÿ“š Tracks, references, and design studies in one placeโ€ข๐ŸŽฏ Nexus teaches Next.js from foundations to professional systemsโ€ขโšก App Router, React 19, and Tailwind v4 in one learning pathโ€ข๐Ÿงฉ Inspect real components, layouts, and reusable patternsโ€ข๐Ÿ› ๏ธ Build production discipline, not just polished demosโ€ข๐Ÿ“š Tracks, references, and design studies in one placeโ€ข๐ŸŽฏ Nexus teaches Next.js from foundations to professional systemsโ€ขโšก App Router, React 19, and Tailwind v4 in one learning pathโ€ข๐Ÿงฉ Inspect real components, layouts, and reusable patternsโ€ข๐Ÿ› ๏ธ Build production discipline, not just polished demosโ€ข๐Ÿ“š Tracks, references, and design studies in one placeโ€ข๐ŸŽฏ Nexus teaches Next.js from foundations to professional systemsโ€ขโšก App Router, React 19, and Tailwind v4 in one learning pathโ€ข๐Ÿงฉ Inspect real components, layouts, and reusable patternsโ€ข๐Ÿ› ๏ธ Build production discipline, not just polished demosโ€ข๐Ÿ“š Tracks, references, and design studies in one placeโ€ข
UI Components

Toast

Global notification system with auto-dismiss, four variants, six positions, and useToast hook

Quick Preview

Installation

// Copy the Toast component from
src/components/ui/Toast.tsx

Usage

// 1. Wrap your app (or layout) with ToastProvider
import { ToastProvider } from '@/components/ui/Toast'
export default function Layout({ children }) {
return (
<ToastProvider position="top-right">
{children}
</ToastProvider>
)
}
// 2. Use the hook anywhere inside the provider
'use client'
import { useToast } from '@/components/ui/Toast'
export default function SaveButton() {
const { addToast } = useToast()
async function handleSave() {
await save()
addToast('Changes saved!', { variant: 'success', duration: 3000 })
}
return <button onClick={handleSave}>Save</button>
}

Examples

Positions

Set position on ToastProvider to control where toasts appear. Options: top-right, top-left, top-center, bottom-right, bottom-left, bottom-center.

Custom Duration

Default duration is 4000 ms. Pass a custom duration (ms) in options.

Prompt Preview

Copy a prompt that recreates this UI

Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.

Copy-ready AI prompt

Starts from the current visual reference and project constraints.

Tweak only product-specific copy or data after the first generation pass.

Props

PropTypeDefaultDescription
message*string-Notification message text
variant"success" | "error" | "warning" | "info""info"Visual variant
durationnumber4000Auto-dismiss delay in milliseconds
positionToastPosition"top-right"Stack position on screen (ToastProvider prop)

Features

  • โœ“Context + useToast hook API
  • โœ“ToastProvider wraps app (or section)
  • โœ“Four variants: success, error, warning, info
  • โœ“Six stack positions
  • โœ“Auto-dismiss with configurable duration
  • โœ“Manual dismiss button
  • โœ“Portal rendering
  • โœ“role="alert" + aria-live
  • โœ“Client Component