# React modal libraries

React modal libraries render dialogs: windows that open over the page, hold keyboard focus, and close on Escape or a button. These libraries handle confirmations, forms, and settings panels that interrupt the page until a person responds.

## Popularity

| Library | Monthly downloads | Stars | Last release | License |
| --- | --- | --- | --- | --- |
| [@radix-ui/react-dialog](#radix-ui-react-dialog) | 365.3M | 19.5K | Oct 2026 | MIT |
| [Base UI](#base-ui-dialog) | 109.8M | 11.4K | Oct 2026 | MIT |
| [Material UI](#mui-material) | 53.7M | 99.3K | Oct 2026 | MIT |
| [Headless UI](#headless-ui-dialog) | 38.2M | 28.8K | Apr 2026 | MIT |
| [React Aria Components](#react-aria-modal) | 33.2M | 16.1K | Oct 2026 | Apache-2.0 |
| [Ant Design](#antd) | 19.9M | 100.2K | Nov 2026 | MIT |
| [Mantine](#mantine-core) | 14.3M | 32.0K | Nov 2026 | MIT |
| [react-modal](#react-modal) | 14.1M | 7.4K | Dec 2024 | MIT |

Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

[@radix-ui/react-dialog](#radix-ui-react-dialog) has the most monthly downloads in this comparison, at 365.3M.

## Capabilities

| Library | Default dialog styles | Can disable focus trapping |
| --- | --- | --- |
| [@radix-ui/react-dialog](#radix-ui-react-dialog) | No | Yes |
| [Base UI](#base-ui-dialog) | No | Yes |
| [Material UI](#mui-material) | Yes | Yes |
| [Headless UI](#headless-ui-dialog) | No | No |
| [React Aria Components](#react-aria-modal) | No | No |
| [Ant Design](#antd) | Yes | Yes |
| [Mantine](#mantine-core) | Yes | Yes |
| [react-modal](#react-modal) | Yes | No |

## Libraries

### @radix-ui/react-dialog

[GitHub](https://github.com/radix-ui/primitives) · [npm](https://www.npmjs.com/package/@radix-ui/react-dialog) · [Docs](https://www.radix-ui.com/primitives/docs/components/dialog)

@radix-ui/react-dialog is the Dialog primitive from Radix: unstyled parts, `Root`, `Trigger`, `Portal`, `Overlay`, `Content`, `Title`, `Description`, and `Close`, that the app assembles and styles. In modal mode, focus stays inside the dialog, the content underneath becomes inert, and Escape closes it. Setting `modal` to false switches to non-modal mode. `Title` and `Description` give screen readers the dialog's name and summary.

- Downloads / mo: 365.3M
- Stars: 19.5K
- Last release: 1.3.1
- License: MIT
- Capabilities: [From the @radix-ui/react-dialog docs](https://www.radix-ui.com/primitives/docs/components/dialog)

**Strengths**

- **Modal and non-modal.** Setting `modal` to false keeps the page behind the dialog interactive.
- **Controlled or uncontrolled.** The dialog tracks its own open state or follows `open` and `onOpenChange`.

**Watch out for**

- **Styles come from the app.** Layout and appearance come from the app's CSS.
- **Custom triggers forward refs.** A custom component used as a trigger accepts Radix's props, event handlers, and ref.

```sh
npm install @radix-ui/react-dialog
```

**shadcn-ui/ui** (128.5K stars)

[shadcn-ui/ui](https://github.com/shadcn-ui/ui) 

```tsx
function DialogContent({
  className,
  children,
  showCloseButton = true,
  ...props
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
  showCloseButton?: boolean
}) {
  return (
    <DialogPortal data-slot="dialog-portal">
      <DialogOverlay />
      <DialogPrimitive.Content
        data-slot="dialog-content"
        className={cn(
          "fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",
          className
        )}
        {...props}
      >
        {children}
        {showCloseButton && (
          <DialogPrimitive.Close
            data-slot="dialog-close"
            className="absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
          >
            <XIcon />
            <span className="sr-only">Close</span>
          </DialogPrimitive.Close>
        )}
      </DialogPrimitive.Content>
    </DialogPortal>
  )
}
```

[apps/v4/registry/new-york-v4/ui/dialog.tsx](https://github.com/shadcn-ui/ui/blob/c257f688cf4de7ec10cc1be84cad29cd4631182c/apps/v4/registry/new-york-v4/ui/dialog.tsx#L50-L82) · [More projects using @radix-ui/react-dialog →](https://dashboard.exa.ai/playground/search?q=%40radix-ui/react-dialog%20GitHub%20projects)

**Quickstart**

```tsx
import * as Dialog from "@radix-ui/react-dialog";

export default function Example() {
  return (
    <Dialog.Root>
      <Dialog.Trigger>Open dialog</Dialog.Trigger>
      <Dialog.Portal>
        <Dialog.Overlay />
        <Dialog.Content>
          <Dialog.Title>Notice</Dialog.Title>
          <Dialog.Description>Review this notice.</Dialog.Description>
          <Dialog.Close>Close</Dialog.Close>
        </Dialog.Content>
      </Dialog.Portal>
    </Dialog.Root>
  );
}

```

From [dialog.md](https://www.radix-ui.com/primitives/docs/components/dialog)

### Base UI

[GitHub](https://github.com/mui/base-ui) · [npm](https://www.npmjs.com/package/@base-ui/react) · [Docs](https://base-ui.com/react/components/button.md)

Base UI is a library of unstyled React components from the MUI team, and its `Dialog` is a popup that opens over the whole page. Parts such as `Dialog.Root`, `Dialog.Trigger`, `Dialog.Backdrop`, `Dialog.Popup`, and `Dialog.Close` take class names or styles from the app. The `modal` prop chooses full modal behavior, no modality, or `trap-focus`, which keeps focus inside the dialog while the page still scrolls and takes clicks.

- Downloads / mo: 109.8M
- Stars: 11.4K
- Last release: 1.9.0
- License: MIT
- Capabilities: [From the Base UI docs](https://base-ui.com/react/components/button.md)

**Strengths**

- **Supports partial modal behavior.** Use trap-focus to contain focus while allowing outside pointer interactions.
- **Supports detached dialog triggers.** Associate triggers with a dialog through a shared handle.

**Watch out for**

- **Close control for touch.** In `trap-focus` mode, a close button inside the dialog lets touch screen reader users leave it.
- **Styles come from the app.** Every dialog part is styled by the app.

```sh
pnpm add @base-ui/react
```

**shadcn-ui/ui** (128.5K stars)

[shadcn-ui/ui](https://github.com/shadcn-ui/ui) 

```typescript
function DialogContent({
  className,
  children,
  showCloseButton = true,
  ...props
}: DialogPrimitive.Popup.Props & {
  showCloseButton?: boolean
}) {
  return (
    <DialogPortal>
      <DialogOverlay />
      <DialogPrimitive.Popup
        data-slot="dialog-content"
        className={cn(
          "cn-dialog-content fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none",
          className
        )}
        {...props}
      >
        {children}
        {showCloseButton && (
          <DialogPrimitive.Close
            data-slot="dialog-close"
            render={
              <Button
                variant="ghost"
                className="cn-dialog-close"
                size="icon-sm"
              />
            }
          >
            <IconPlaceholder
              lucide="XIcon"
              tabler="IconX"
              hugeicons="Cancel01Icon"
              phosphor="XIcon"
              remixicon="RiCloseLine"
            />
            <span className="sr-only">Close</span>
          </DialogPrimitive.Close>
        )}
      </DialogPrimitive.Popup>
    </DialogPortal>
  )
}
```

[apps/v4/registry/bases/base/ui/dialog.tsx](https://github.com/shadcn-ui/ui/blob/c257f688cf4de7ec10cc1be84cad29cd4631182c/apps/v4/registry/bases/base/ui/dialog.tsx#L39-L83) · [More projects using Base UI →](https://dashboard.exa.ai/playground/search?q=React%20projects%20using%20%40base-ui/react%20for%20modal%20dialogs%2C%20accessible%20focus%20behavior%2C%20dismissal%20state%2C%20layered%20overlays%20and%20navigation%20panels&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```typescript
import { Dialog } from '@base-ui/react/dialog';

export default function Example() {
  return (
    <Dialog.Root>
      <Dialog.Trigger>Open</Dialog.Trigger>
      <Dialog.Portal>
        <Dialog.Popup>
          <Dialog.Title>Example dialog</Dialog.Title>
          <Dialog.Close>Close</Dialog.Close>
        </Dialog.Popup>
      </Dialog.Portal>
    </Dialog.Root>
  );
}

```

From [dialog.md](https://base-ui.com/react/components/dialog.md)

### Material UI

[GitHub](https://github.com/mui/material-ui) · [npm](https://www.npmjs.com/package/@mui/material) · [Docs](https://mui.com/material-ui/getting-started/)

Material UI is a React component library that implements Google's Material Design, and its `Dialog` renders a modal window in front of the app with Material styling. `DialogTitle`, `DialogContent`, `DialogContentText`, and `DialogActions` lay out the title, body, and buttons. The `fullScreen` prop fills the screen, and `slots.transition` swaps the default transition for one such as `Slide`. Dialogs follow the app's MUI theme.

- Downloads / mo: 53.7M
- Stars: 99.3K
- Last release: 9.5.0
- License: MIT
- Capabilities: [From the Material UI docs](https://mui.com/material-ui/getting-started/)

**Strengths**

- **Material styling included.** Dialogs come styled to Material Design and follow the app's theme.
- **Full screen on small screens.** `fullScreen` combined with `useMediaQuery` fills the screen below a breakpoint.

**Watch out for**

- **Installs a full UI library.** The dialog comes from `@mui/material`, which installs with Emotion for styling.

```sh
npm install @mui/material @emotion/react @emotion/styled
```

**Quickstart**

```tsx
import { Dialog, DialogTitle, DialogContent } from '@mui/material';

export default function Example() {
  return (
    <Dialog open>
      <DialogTitle>Notice</DialogTitle>
      <DialogContent>Review this notice.</DialogContent>
    </Dialog>
  );
}

```

From [react-dialog.md](https://mui.com/material-ui/react-dialog/) · [Find projects using Material UI →](https://dashboard.exa.ai/playground/search?q=%40mui/material%20GitHub%20projects)

### Headless UI

[GitHub](https://github.com/tailwindlabs/headlessui) · [npm](https://www.npmjs.com/package/@headlessui/react) · [Docs](https://headlessui.com/react/button)

Headless UI is a set of unstyled, accessible React components from Tailwind Labs, the company behind Tailwind CSS. Its `Dialog` is controlled by `open` and `onClose`, and `DialogPanel`, `DialogTitle`, and `Description` mark the panel, title, and description. Focus stays inside the open dialog, the dialog renders into a portal, and Escape or a click outside the panel calls `onClose`.

- Downloads / mo: 38.2M
- Stars: 28.8K
- Last release: 2.2.10
- License: MIT
- Capabilities: [From the Headless UI docs](https://headlessui.com/react/button)

**Strengths**

- **Contains keyboard focus.** Tab navigation stays inside the open dialog.
- **Portals dialogs automatically.** Dialog renders into a dedicated portal outside the application root.

**Watch out for**

- **The app holds open state.** The dialog opens and closes only through the `open` prop, which the app updates in `onClose`.
- **Styles come from the app.** Layout and appearance come from class names, styles, or child elements.
- **Modal only.** Focus always stays inside the open dialog, with no non-modal mode.

```sh
npm install @headlessui/react
```

**makeplane/plane** (62.7K stars)

[makeplane/plane](https://github.com/makeplane/plane) 

```typescript
export function ModalCore(props: Props) {
  const {
    children,
    handleClose,
    isOpen,
    position = EModalPosition.CENTER,
    width = EModalWidth.XXL,
    className = "",
  } = props;

  return (
    <Transition.Root show={isOpen} as={Fragment}>
      <Dialog as="div" className="relative z-30" onClose={() => handleClose && handleClose()}>
        <Transition.Child
          as={Fragment}
          enter="ease-out duration-300"
          enterFrom="opacity-0"
          enterTo="opacity-100"
          leave="ease-in duration-200"
          leaveFrom="opacity-100"
          leaveTo="opacity-0"
        >
          <div className="fixed inset-0 bg-backdrop transition-opacity" />
        </Transition.Child>

        <div className="fixed inset-0 z-30 overflow-y-auto">
          <div className={position}>
            <Transition.Child
              as={Fragment}
              enter="ease-out duration-300"
              enterFrom="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
              enterTo="opacity-100 translate-y-0 sm:scale-100"
              leave="ease-in duration-200"
              leaveFrom="opacity-100 translate-y-0 sm:scale-100"
              leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
            >
              <Dialog.Panel
                className={cn(
                  "relative w-full transform rounded-lg bg-surface-1 text-left shadow-raised-200 transition-all",
                  width,
                  className
                )}
              >
                {children}
              </Dialog.Panel>
            </Transition.Child>
          </div>
        </div>
      </Dialog>
    </Transition.Root>
  );
}

```

[packages/ui/src/modals/modal-core.tsx](https://github.com/makeplane/plane/blob/c62930ebcfab1a9591379289d505effbe92dcf32/packages/ui/src/modals/modal-core.tsx#L22-L73) · [More projects using Headless UI →](https://dashboard.exa.ai/playground/search?q=React%20projects%20using%20%40headlessui/react%20for%20modal%20dialogs%2C%20accessible%20focus%20behavior%2C%20dismissal%20state%2C%20layered%20overlays%20and%20navigation%20panels&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```typescript
import { Description, Dialog, DialogPanel, DialogTitle } from '@headlessui/react'
import { useState } from 'react'

function Example() {
  let [isOpen, setIsOpen] = useState(false)

  return (
    <>
      <button onClick={() => setIsOpen(true)}>Open dialog</button>
      <Dialog open={isOpen} onClose={() => setIsOpen(false)} className="relative z-50">
        <div className="fixed inset-0 flex w-screen items-center justify-center p-4">
          <DialogPanel className="max-w-lg space-y-4 border bg-white p-12">
            <DialogTitle className="font-bold">Deactivate account</DialogTitle>
            <Description>This will permanently deactivate your account</Description>
            <p>Are you sure you want to deactivate your account? All of your data will be permanently removed.</p>
            <div className="flex gap-4">
              <button onClick={() => setIsOpen(false)}>Cancel</button>
              <button onClick={() => setIsOpen(false)}>Deactivate</button>
            </div>
          </DialogPanel>
        </div>
      </Dialog>
    </>
  )
}

```

From [dialog.md](https://headlessui.com/react/dialog)

### React Aria Components

[GitHub](https://github.com/adobe/react-spectrum) · [npm](https://www.npmjs.com/package/react-aria-components) · [Docs](https://react-spectrum.adobe.com/react-aria/getting-started.html)

React Aria Components is Adobe's library of accessible, unstyled React components. A modal is built from three of them: `ModalOverlay` for the backdrop, `Modal` for the container, and `Dialog` for the labeled content, usually opened by a `DialogTrigger` around a button. Render props such as `isEntering` and `isExiting` style enter and exit animations. A click outside closes the modal only when `isDismissable` is set.

- Downloads / mo: 33.2M
- Stars: 16.1K
- Last release: 1.22.1
- License: Apache-2.0
- Capabilities: [From the React Aria Components docs](https://react-spectrum.adobe.com/react-aria/getting-started.html)

**Strengths**

- **Supports animated overlay states.** Use isEntering and isExiting states to style modal transitions.
- **Separates overlay and content composition.** Compose ModalOverlay, Modal, and Dialog for the modal structure.

**Watch out for**

- **Needs a labeled Dialog.** A `Dialog` with a heading in its title slot gives screen readers the modal's name.
- **Outside clicks opt in.** `isDismissable` turns on closing the modal with a click outside it.
- **Modal only.** The overlay always blocks interaction outside it, with no switch to turn that off.

```sh
npm install react-aria-components
```

**actualbudget/actual** (30.3K stars)

[actualbudget/actual](https://github.com/actualbudget/actual) 

```typescript
export const Modal = ({
  name,
  isLoading = false,
  noAnimation = false,
  style,
  children,
  onClose,
  wrapperProps,
  containerProps,
  presentation = 'dialog',
  ariaLabelledBy,
  ...props
}: ModalProps) => {
  const { t } = useTranslation();
  const { isNarrowWidth } = useResponsive();
  const isSheet = presentation === 'sheet' && isNarrowWidth;
  const viewport = useVisualViewport();
  const { enableScope, disableScope } = useHotkeysContext();

  // This deactivates any key handlers in the "app" scope
  useEffect(() => {
    enableScope(name);
    return () => disableScope(name);
  }, [enableScope, disableScope, name]);

  const { isHidden, isActive, onClose: closeModal } = useModalState();
  const dispatch = useDispatch();
  const prefersReducedMotion = useReducedMotion();
  const isAnimatedSheet = isSheet && !prefersReducedMotion;
  const [isOpen, setIsOpen] = useState(true);
  const isClosingRef = useRef(false);
  const closeTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);

  useEffect(() => {
    return () => {
      if (closeTimerRef.current) {
        clearTimeout(closeTimerRef.current);
      }
    };
  }, []);

  const handleOnClose = () => {
    if (isClosingRef.current) {
      return;
    }
    isClosingRef.current = true;
    const finishClose = () => {
      if (isSheet) {
        dispatch(collapseModals({ rootModalName: name }));
      } else {
        closeModal();
      }
      onClose?.();
    };
    if (isAnimatedSheet) {
      closeTimerRef.current = setTimeout(finishClose, SHEET_EXIT_MS);
      return;
    }
    finishClose();
  };

  const sheetRef = useSwipeToDismiss({
    isEnabled: isSheet,
    onDismiss: () => {
      setIsOpen(false);
      handleOnClose();
    },
  });

  return (
    <ErrorBoundary FallbackComponent={FeatureErrorFallback}>
      <ReactAriaModalOverlay
        data-testid={`${name}-modal`}
        className={isAnimatedSheet ? mobileSheetOverlayClassName : undefined}
        isDismissable
        isOpen={isOpen}
        onOpenChange={nextIsOpen => {
          setIsOpen(nextIsOpen);
          if (!nextIsOpen) {
            handleOnClose();
          }
        }}
        style={{
          position: 'fixed',
          inset: 0,
          zIndex: MODAL_Z_INDEX,
          fontSize: 14,
          // on mobile, we disable the blurred background for performance reasons
          ...(isNarrowWidth
            ? {
                backgroundColor: 'rgba(0, 0, 0, 0.4)',
              }
            : {
                backdropFilter: 'blur(1px) brightness(0.9)',
              }),
          ...style,
        }}
        {...props}
      >
        {/* A container for positioning the modal relative to the visual viewport */}
        <View
          nativeStyle={{
            // React Aria's height removes pinch zoom scaling. Safari page zoom
            // needs CSS pixels, including keyboard resizing while zoomed.
            '--visual-viewport-height': `${viewport.height}px`,
            top: viewport.offsetTop,
          }}
          style={{
            display: 'flex',
            ...(isSheet
              ? { alignItems: 'stretch', justifyContent: 'flex-end' }
              : { alignItems: 'center', justifyContent: 'center' }),
            height: 'var(--visual-viewport-height)',
            overflowY: 'auto',
            ...wrapperProps?.style,
          }}
        >
          <ReactAriaModal
            ref={sheetRef}
            className={isAnimatedSheet ? mobileSheetModalClassName : undefined}
          >
            {modalProps => (
              <Dialog
                aria-label={ariaLabelledBy ? undefined : t('Modal dialog')}
                aria-labelledby={ariaLabelledBy}
                className={css(styles.lightScrollbar)}
                style={{
                  outline: 'none', // remove focus outline
                }}
              >
                <ModalContentContainer
                  noAnimation={noAnimation || isSheet}
                  isActive={isActive(name)}
                  {...containerProps}
                  style={{
                    flex: 1,
                    padding: 10,
                    willChange: isSheet ? undefined : 'opacity, transform',
                    maxWidth: '90vw',
                    minWidth: '90vw',
                    maxHeight: 'calc(var(--visual-viewport-height) * 0.9)',
                    minHeight: 0,
                    borderRadius: 6,
                    //border: '1px solid ' + theme.modalBorder,
                    color: theme.pageText,
                    backgroundColor: theme.modalBackground,
                    opacity: isHidden ? 0 : 1,
                    [`@media (min-width: ${tokens.breakpoint_small})`]: {
                      minWidth: tokens.breakpoint_small,
                    },
                    overflowY: 'auto',
                    ...styles.shadowLarge,
                    ...(isSheet && mobileSheetContainerStyle),
                    ...containerProps?.style,
                  }}
                >
                  {isSheet && <View style={mobileSheetHandleStyle} />}
                  <View style={{ paddingTop: 0, flex: 1, flexShrink: 0 }}>
                    <ErrorBoundary FallbackComponent={FeatureErrorFallback}>
                      {typeof children === 'function'
                        ? children(modalProps)
                        : children}
                    </ErrorBoundary>
                  </View>
                  {isLoading && (
                    <View
                      style={{
                        position: 'absolute',
                        top: 0,
                        left: 0,
                        right: 0,
                        bottom: 0,
                        backgroundColor: theme.pageBackground,
                        alignItems: 'center',
                        justifyContent: 'center',
                        zIndex: 1000,
                      }}
                    >
                      <AnimatedLoading
                        style={{ width: 20, height: 20 }}
                        color={theme.pageText}
                      />
                    </View>
                  )}
                </ModalContentContainer>
              </Dialog>
            )}
          </ReactAriaModal>
        </View>
      </ReactAriaModalOverlay>
    </ErrorBoundary>
  );
};

```

[packages/desktop-client/src/components/common/Modal.tsx](https://github.com/actualbudget/actual/blob/6e761b42c2c4a0c9326dfb6af787fe81e0b66bc2/packages/desktop-client/src/components/common/Modal.tsx#L106-L298) · [More projects using React Aria Components →](https://dashboard.exa.ai/playground/search?q=React%20projects%20using%20react-aria-components%20for%20modal%20dialogs%2C%20accessible%20focus%20behavior%2C%20dismissal%20state%2C%20layered%20overlays%20and%20navigation%20panels&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```typescript
import { Modal, Dialog, Heading } from 'react-aria-components';

export default function Example() {
  return (
    <Modal isOpen>
      <Dialog>
        <Heading slot="title">Notice</Heading>
        <p>Review this notice.</p>
      </Dialog>
    </Modal>
  );
}

```

From [Modal.md](https://react-spectrum.adobe.com/react-aria/Modal.html)

### Ant Design

[GitHub](https://github.com/ant-design/ant-design) · [npm](https://www.npmjs.com/package/antd) · [Docs](https://ant.design/docs/react/introduce)

Ant Design is a React component library for enterprise apps, and its `Modal` renders a styled dialog with a title, a body, and OK and Cancel buttons, controlled by `open`, `onOk`, and `onCancel`. Static methods such as `Modal.confirm` open a confirmation dialog from a function call, and `Modal.useModal()` does the same while reading theme and locale settings from the app. `confirmLoading` shows a loading state on the OK button while an action runs.

- Downloads / mo: 19.9M
- Stars: 100.2K
- Last release: 6.7.1
- License: MIT
- Capabilities: [From the Ant Design docs](https://ant.design/docs/react/introduce)

**Strengths**

- **OK and Cancel built in.** The footer comes with OK and Cancel buttons wired to `onOk` and `onCancel`.
- **Confirmation from a call.** `Modal.confirm` opens a confirmation dialog without rendering a component.

**Watch out for**

- **Static methods skip context.** `Modal.confirm` can't read `ConfigProvider` settings; `Modal.useModal()` and its `contextHolder` can.

```sh
npm install antd --save
```

**Quickstart**

```tsx
import { Modal } from 'antd';

export default function Example() {
  return (
    <Modal open title="Notice">
      <p>Review this notice.</p>
    </Modal>
  );
}

```

From [modal.md](https://ant.design/components/modal/) · [Find projects using Ant Design →](https://dashboard.exa.ai/playground/search?q=antd%20GitHub%20projects)

### Mantine

[GitHub](https://github.com/mantinedev/mantine) · [npm](https://www.npmjs.com/package/@mantine/core) · [Docs](https://mantine.dev/getting-started/)

Mantine is a React component library, and its `Modal` renders a styled dialog controlled by `opened` and `onClose`, often paired with the `useDisclosure` hook from `@mantine/hooks`. Props set the title, size, vertical centering, and transition. The `fullScreen` prop fills the screen, and combined with the media query hook it applies on small screens only. Focus trapping is on by default and turns off with `trapFocus`.

- Downloads / mo: 14.3M
- Stars: 32.0K
- Last release: 9.8.1
- License: MIT
- Capabilities: [From the Mantine docs](https://mantine.dev/getting-started/)

**Strengths**

- **Themed styling.** The modal follows the Mantine theme the app already uses.
- **Full screen option.** `fullScreen` fills the screen, and a media query can limit it to small screens.

**Watch out for**

- **Provider setup first.** The app wraps itself in `MantineProvider` and imports Mantine's styles before the modal renders.

```sh
yarn add @mantine/core @mantine/hooks
```

**medplum/medplum** (2.8K stars)

[medplum/medplum](https://github.com/medplum/medplum) 

```tsx
export function SendPasswordResetModal(props: SendPasswordResetModalProps): JSX.Element {
  const medplum = useMedplum();
  const [submitting, setSubmitting] = useState(false);

  function handleSubmit(): void {
    setSubmitting(true);
    medplum
      .post(`admin/projects/${props.projectId}/members/${props.membershipId}/resetpassword`, {})
      .then(() => {
        showNotification({ color: 'green', message: 'Password reset email sent.' });
        props.onSuccess?.();
        props.onClose();
      })
      .catch((err) => showNotification({ color: 'red', message: normalizeErrorString(err), autoClose: false }))
      .finally(() => setSubmitting(false));
  }

  return (
    <Modal opened={props.opened} onClose={props.onClose} title="Send password reset email" centered>
      <Stack>
        <Text size="sm">
          Send this member an email with a single-use link to set a new password. Their current password remains valid
          until they complete the reset.
        </Text>
        <Group justify="flex-end">
          <Button variant="default" onClick={props.onClose}>
            Cancel
          </Button>
          <Button color="blue" loading={submitting} onClick={handleSubmit}>
            Send email
          </Button>
        </Group>
      </Stack>
    </Modal>
  );
}
```

[packages/app/src/admin/AccountSecurity.tsx](https://github.com/medplum/medplum/blob/32f5d1ed09d2ceb9abb0e0801b770555ac77ac1b/packages/app/src/admin/AccountSecurity.tsx) · [More projects using Mantine →](https://dashboard.exa.ai/playground/search?q=%40mantine/core%20GitHub%20projects)

**Quickstart**

```tsx
import { useDisclosure } from '@mantine/hooks';
import { Modal, Button } from '@mantine/core';

function Demo() {
  const [opened, { open, close }] = useDisclosure(false);

  return (
    <>
      <Modal opened={opened} onClose={close} title="Authentication">
        {/* Modal content */}
      </Modal>

      <Button variant="default" onClick={open}>
        Open modal
      </Button>
    </>
  );
}

```

From [Demo.tsx](https://mantine.dev/core/modal/)

### react-modal

[GitHub](https://github.com/reactjs/react-modal) · [npm](https://www.npmjs.com/package/react-modal) · [Docs](https://reactcommunity.org/react-modal/)

react-modal is a standalone, accessible modal component for React. `ReactModal` opens when `isOpen` is true, takes a `contentLabel` for screen readers, and calls `onRequestClose` on Escape or a click on the overlay. `ReactModal.setAppElement` names the app's root element so it is hidden from screen readers while the modal is open. The content and overlay come with basic inline styles, which the `style` prop or class names replace.

- Downloads / mo: 14.1M
- Stars: 7.4K
- Last release: 3.16.3
- License: MIT
- Capabilities: [From the react-modal docs](https://reactcommunity.org/react-modal/)

**Strengths**

- **Restores prior focus automatically.** Closing the modal returns focus to the previously focused element.
- **Supports Escape-key dismissal.** Users can close the modal with Escape unless this behavior is disabled.

**Watch out for**

- **App element set first.** `ReactModal.setAppElement` points at the app's root so background content gets `aria-hidden`.
- **Classes replace default styles.** A custom content or overlay class drops the default inline styles. The class then supplies every style.
- **Focus always contained.** Tab always cycles inside the open modal, with no prop to turn that off.

```sh
npm install react-modal
```

**tilt-dev/tilt** (10.1K stars)

[tilt-dev/tilt](https://github.com/tilt-dev/tilt) 

```typescript
render() {
    let showModal =
      Boolean(this.props.error) &&
      (this.props.showFatalErrorModal === ShowFatalErrorModal.Default ||
        this.props.showFatalErrorModal === ShowFatalErrorModal.Show)
    return (
      <Modal
        isOpen={showModal}
        className="FatalErrorModal"
        onRequestClose={this.props.handleClose}
      >
        <h2 className="FatalErrorModal-title">Fatal Error</h2>
        <div className="FatalErrorModal-pane">
          <p>Tilt has encountered a fatal error: {this.props.error}</p>
          <p>
            Once you fix this issue you'll need to restart Tilt. In the meantime
            feel free to browse through the UI.
          </p>
        </div>
      </Modal>
    )
  }
```

[web/src/FatalErrorModal.tsx](https://github.com/tilt-dev/tilt/blob/30a5e684c83f2532ef60435c370a8853cdeceb03/web/src/FatalErrorModal.tsx) · [More projects using react-modal →](https://dashboard.exa.ai/playground/search?q=React%20projects%20using%20react-modal%20for%20modal%20dialogs%2C%20accessible%20focus%20behavior%2C%20dismissal%20state%2C%20layered%20overlays%20and%20navigation%20panels&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```typescript
import ReactModal from 'react-modal';

ReactModal.setAppElement('#root');

export default function Example() {
  return (
    <ReactModal isOpen contentLabel="Notice">
      <p>Review this notice.</p>
    </ReactModal>
  );
}

```

From [README.md](https://reactcommunity.org/react-modal/)

## FAQ

### Which React modal library should I use?

In an app that already uses Material UI, Ant Design, or Mantine, use that library's dialog. For a custom design, use an unstyled primitive: [Radix Dialog](#radix-ui-react-dialog) or [Base UI](#base-ui-dialog) for modal and non-modal dialogs, [Headless UI](#headless-ui-dialog) alongside Tailwind CSS, or [React Aria Components](#react-aria-modal) for animated overlays.

### What does the shadcn/ui Dialog use?

The shadcn/ui Dialog wraps [Radix Dialog](#radix-ui-react-dialog) and adds Tailwind CSS styles. A second shadcn/ui base builds the same component on [Base UI](#base-ui-dialog).

### How do I open a dialog in Material UI?

Render `Dialog` with an `open` prop and an `onClose` handler from [Material UI](#mui-material), and place `DialogTitle`, `DialogContent`, and `DialogActions` inside it. The `fullScreen` prop fills the screen, for example below a breakpoint read with `useMediaQuery`.

### How do I show a confirmation modal in Ant Design?

Call `Modal.confirm` from [Ant Design](#antd) to open a confirmation dialog without rendering a component. To read theme and locale settings from `ConfigProvider`, use the `modal` instance from `Modal.useModal()` and render its `contextHolder`.

### Can a Radix dialog let the page stay interactive?

Yes. Setting `modal` to false on [Radix Dialog](#radix-ui-react-dialog) turns off focus trapping and lets the page behind the dialog take clicks. [Base UI](#base-ui-dialog) also has a `trap-focus` mode that keeps focus inside without blocking the page.

### Radix Dialog vs Headless UI Dialog: what's the difference?

Both are unstyled. Radix splits the dialog into parts such as `Trigger`, `Overlay`, and `Content`, and offers a non-modal mode. [Headless UI](#headless-ui-dialog) is controlled through `open` and `onClose`, always keeps focus inside the dialog, and renders it in a portal.

## How this page was built

Data checked Nov 20, 2026.

Reproduce it with the Exa API:

```json
{
  "endpoint": "/search",
  "body": {
    "query": "Best React modal libraries Radix Headless UI React Aria Base UI react-modal examples",
    "numResults": 5
  }
}
```

Docs: https://exa.ai/docs/reference/search
