Hero Ui

Modal

Component 1

About

Accessible dialog overlay for focused user interactions, with sizes, placement, dismiss control, and controlled state.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Modal to your project and fits it to your theme.

Code

How Modal is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client"

import { Rocket } from "lucide-react"
import { Button, Modal } from "@/components/ui/heroui-modal"

export default function Demo() {
  return (
    <Modal>
      <Button variant="secondary">Open Modal</Button>
      <Modal.Backdrop>
        <Modal.Container>
          <Modal.Dialog className="sm:max-w-[360px]">
            <Modal.CloseTrigger />
            <Modal.Header>
              <Modal.Icon className="bg-default text-foreground">
                <Rocket className="size-5" />
              </Modal.Icon>
              <Modal.Heading>Welcome to HeroUI</Modal.Heading>
            </Modal.Header>
            <Modal.Body>
              <p>
                A beautiful, fast, and modern React UI library for building accessible and
                customizable web applications with ease.
              </p>
            </Modal.Body>
            <Modal.Footer>
              <Button className="w-full" slot="close">
                Continue
              </Button>
            </Modal.Footer>
          </Modal.Dialog>
        </Modal.Container>
      </Modal.Backdrop>
    </Modal>
  )
}

Dependencies

More by Hero Ui

View all
  • DatePicker

    DatePicker

    473
  • Chip

    Chip

    449
  •  The Pagination

    The Pagination

    367
  • HeroUI Table

    HeroUI Table

    123
  • HeroUI Color Picker

    HeroUI Color Picker

    116
  • Skeleton

    Skeleton

    107
  • HeroUI Disclosure Group

    HeroUI Disclosure Group

    98
  • HeroUI AlertDialog

    HeroUI AlertDialog

    85