UI Siêu Ngon

Modal

Dialog overlay rendered in a portal. Features entry/exit animations, scroll lock, backdrop click, and Escape key support.

Playground
title
size
Hide close ×
Close on backdrop
rounded
const [open, setOpen] = useState(false);

<Button onClick={() => setOpen(true)}>Open Modal</Button>

<Modal
  open={open}
  onClose={() => setOpen(false)}
  title="My Modal"
>
  <p>Modal body content.</p>
</Modal>

Basic

With Footer

Pass footer prop to render action buttons at the bottom.

Sizes

sm, md (default), lg, xl, full.

No Backdrop Close

Set closeOnBackdrop={false} to prevent closing on backdrop click.

API

PropertyTypeDefaultDescription
open*booleanControls visibility
onClose*() => voidCalled when the user closes the modal
titleReactNodeModal title shown in the header
size"sm" | "md" | "lg" | "xl" | "full""md"Width preset
footerReactNodeContent rendered in the footer area
closeOnBackdropbooleantrueClose when clicking the backdrop
closeOnEscapebooleantrueClose on Escape key
hideCloseButtonbooleanfalseHide the × button in the header
classNamestringExtra class on the modal panel
bodyClassNamestringExtra class on the body area