React Modal

A flexible and accessible modal dialog component that displays content in a layer above the page.

Basic Usage

Features

  • ✅ Portal Rendering - Renders at document body level to avoid z-index conflicts
  • ✅ Theme Support - Automatic dark/light mode support
  • ✅ Multiple Sizes - sm, md, lg, xl options for different content needs
  • ✅ Accessible - ARIA attributes, keyboard navigation, focus management
  • ✅ Easy Close - ESC key, click outside, or close button
  • ✅ Scroll Lock - Prevents background scrolling when open

Animation Types

Smooth scale-in with spring physics

Slides down from top with gentle bounce

Simple fade-in animation

Playful bounce with rotation

Installation

npx shadcn@latest add "http://localhost:3000/registry/modal.json"

Size Variants

Form Modals

Confirmation Modals

Success & No Title Modals

Props

PropTypeDefaultDescription
isOpenboolean—Controls modal visibility
onClose() => void—Called when modal should close
childrenReactNode—Content inside the modal
titlestringundefinedOptional header title
size'sm' 'md' 'lg' 'xl''md'Modal size
animation'scale' 'slide' 'fade' 'bounce''scale'Animation type

Usage

Loading...

New components every week

Get the week's new Kelvin UI components and templates in one short email. No spam, unsubscribe anytime.