@radix-ui/react-dialog downloads · last 12 months
@radix-ui/react-dialog provides React components for building modal and non-modal dialog interfaces. It addresses the coordination involved in presenting dialog content, managing its open state, and supporting accessible interaction within a React UI.
The package is part of the Radix UI component library and is aimed at developers building component libraries, design systems, or application interfaces. Its focused dialog scope lets teams compose a dialog into their own visual design rather than adopting a complete, pre-styled UI kit.
The dialog is composed from named React parts, including Root, Trigger, Portal, Overlay, Content, Title, Description, and Close. This pattern lets you control how the dialog opens, where its content is rendered, and which elements provide its structure; Root can also be controlled through open and onOpenChange. Use these parts together to build the dialog around your application’s content and interaction flow.
As a React package, @radix-ui/react-dialog fits projects that use React and workflows centered on reusable UI components. Its accessibility, component-library, design-system, and UI-component topics reflect its role in interfaces where dialog behavior and application-specific styling need to coexist.
The supplied package data lists version 1.3.1, an MIT license, an unpacked size of 107.3 kB, and a gzip bundle size of 18.4 kB. It also reports 31.5M weekly downloads, 19.4K GitHub stars, 1.3K forks, 240 open issues, and a last-updated date of 2026-10-14; these figures provide adoption and maintenance context, but do not replace checking compatibility with your own React setup.
This package is specifically for dialog interfaces, not a general-purpose state or layout solution. Because its API is compositional, teams should plan their own styling and assemble the parts they need; projects seeking a ready-made visual dialog should account for that implementation work.
- Build a modal dialog from composable parts, using Root, Trigger, Portal, Overlay, and Content to define its opening and presentation.
- Keep dialog visibility under application control by supplying open and onOpenChange to Root.
- Provide explicit dialog structure with Title and Description alongside Content.
- Add a close affordance in the dialog using the Close part rather than embedding dialog behavior in a custom control.
- Integrate dialog behavior into a React component library or design system while applying your own visual styling.
- Render dialog content through Portal when you want to use the package’s portal-based composition pattern.
- Use the package when a React interface needs a dedicated dialog component rather than a general-purpose overlay implementation.
- Avoid it for non-React interfaces; use the dialog or overlay mechanisms available in the framework or platform you are building for.
- Avoid it when the interface needs only a small piece of local state and no dialog structure; manage that state directly with the application’s existing React patterns.
- Avoid it when you need a ready-made visual dialog with styling included; use an existing styled component in your project or build the required presentation layer.
- Avoid it for popovers, menus, or other interaction patterns that are not dialogs; choose a component designed for that specific interaction instead.
- Avoid it when you do not want to compose separate dialog parts such as Root, Content, Title, and Close; use a higher-level dialog component already available in your UI layer.
- Avoid adding it solely to display static content that does not open or close as a dialog; render that content directly in the page.
CORRECTIONS
Spot wrong data here?Spot wrong data on this page?
A short note helps us fix it.A short note helps us fix it. We read every one; confirmed fixes ship in the next nightly build.
Anonymous · No account · No email back