Modal

A dialog overlay built on Radix UI's Dialog primitive. Features a blurred backdrop, smooth zoom-fade animations, and a built-in close button.

Usage

import { Modal, Button } from "@bloomkit/react";
 
function Example() {
  const [open, setOpen] = useState(false);
 
  return (
    <>
      <Button variant="primary" onClick={() => setOpen(true)}>
        Open modal
      </Button>
 
      <Modal
        open={open}
        onOpenChange={setOpen}
        title="Confirm action"
        description="Are you sure you want to continue? This action cannot be undone."
      >
        <div className="flex justify-end gap-[var(--space-sm)]">
          <Button variant="ghost" onClick={() => setOpen(false)}>Cancel</Button>
          <Button variant="primary" onClick={() => setOpen(false)}>Confirm</Button>
        </div>
      </Modal>
    </>
  );
}

Props

PropTypeDefaultDescription
openboolean—Controls whether the modal is visible
onOpenChange(open: boolean) => void—Callback fired when the modal open state changes
titlestring—Heading rendered at the top of the modal
descriptionstring—Subtext rendered below the title
childrenReactNode—Modal body content
classNamestring""Additional Tailwind classes applied to the dialog content panel