๐ŸŽฏ 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

Modal

Accessible dialog overlay with backdrop, ESC close, body scroll lock, and composable sub-components

Quick Preview

Installation

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

Usage

'use client'
import { useState } from 'react'
import { Modal, ModalHeader, ModalBody, ModalFooter } from '@/components/ui/Modal'
import { Button } from '@/components/ui/Button'
export default function Example() {
const [open, setOpen] = useState(false)
return (
<>
<Button onClick={() => setOpen(true)}>Open Modal</Button>
<Modal isOpen={open} onClose={() => setOpen(false)}>
<ModalHeader>
<h2 className="text-lg font-semibold">Title</h2>
</ModalHeader>
<ModalBody>
<p className="text-gray-600 text-sm">Modal content goes here.</p>
</ModalBody>
<ModalFooter>
<Button variant="ghost" onClick={() => setOpen(false)}>Cancel</Button>
<Button onClick={() => setOpen(false)}>Confirm</Button>
</ModalFooter>
</Modal>
</>
)
}

Examples

Confirm / Destructive Dialog

Size Variants

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

Sub-components ModalHeader, ModalBody, and ModalFooter accept children and className.

PropTypeDefaultDescription
isOpen*boolean-Controls dialog visibility
onClose*() => void-Called when the modal should close
size"sm" | "md" | "lg" | "xl" | "full""md"Dialog width preset
closeOnBackdropbooleantrueClose when clicking the backdrop
closeOnEscbooleantrueClose on Escape key press
classNamestring-Additional CSS classes for the dialog panel

Features

  • โœ“Portal rendering into document.body
  • โœ“ESC key to close
  • โœ“Backdrop click to close
  • โœ“Body scroll lock when open
  • โœ“Auto-focuses close button on open
  • โœ“ModalHeader / ModalBody / ModalFooter sub-components
  • โœ“aria-modal + role="dialog"
  • โœ“Five size presets
  • โœ“Client Component