Beautifully designed Modal Component built with Radix UI and Tailwind CSS.

Click the button below to present a modal. You can also click outside the modal to dismiss it.

<Modal />

To define a declarative modal.

import { useState } from "react"
import { Modal } from "rc-modal-sheet"

export const App = () => {
  const [open, setOpen] = useState(false)
  return (
    <>
      <Button
        onClick={() => {
          setOpen(true)
        }}
      >
        Open Modal
      </Button>
      <Modal title="A declaratively modal" open={open} onOpenChange={setOpen}>
        <p>
          This is a modal. You can put anything you want in here. And It can be
          nested.
        </p>
      </Modal>
    </>
  )
}

ModalProps

nametypeoptionaldefaultdescription
titlestringfalsen/a
CustomModalComponentFC<{ children?: ReactNode; }> | undefinedtruen/a
contentFC<ModalContentPropsInternal>falsen/a
clickOutsideToDismissboolean | undefinedtruen/a
modalClassNamestring | undefinedtruen/a
modalContainerClassNamestring | undefinedtruen/a
maxboolean | undefinedtruen/aIf true, the modal will be full screen.
wrapperFC<{}> | undefinedtruen/a