Lambda UI
v1.3.4
Stable

Dialog

Dialog component displays content in a modal overlay, requiring user interaction before returning to the main content.

Playground

Experiment with all the properties of the Dialog component in real time.

Properties
title

Content for the dialog header/title.

transitionMode

Animation type when opening/closing the dialog.

backdropType

Style of the backdrop overlay.

isModal

If true, clicking outside won't close the dialog.

isDraggable

If true, the dialog can be dragged by its header.

showCloseButton

If true, displays a close button in the header.

Usage

import { Dialog, Button } from "lambda-ui-components";
import { useState } from "react";

export default function App() {
	const [isOpen, setIsOpen] = useState(false);

	return (
		<>
			<Button onClick={() => setIsOpen(true)} label="Open Dialog" />
			<Dialog
				isOpen={isOpen}
				onClose={() => setIsOpen(false)}
				title="Confirm Action"
				footer={
					<div className="flex gap-2 justify-end">
						<Button onClick={() => setIsOpen(false)} label="Cancel" variant="outline" />
						<Button onClick={() => setIsOpen(false)} label="Confirm" />
					</div>
				}
			>
				<p className="text-center py-8 px-12">Are you sure you want to proceed with this action?</p>
			</Dialog>
		</>
	);
}

Draggable Dialog

Set isDraggable to true to allow users to drag the dialog by its header.

Set isModal to true to prevent closing the dialog by clicking outside. Users must use the close button or cancel action.

Close on Escape

Set closeOnEscape to false to prevent the dialog from closing when the Escape key is pressed. This is useful for critical dialogs that require explicit user action.

API Reference

Props

Prop
Default
Type
isOpen
false
boolean
onClose
undefined
() => void
children
undefined
ReactNode
title
undefined
ReactNode
footer
undefined
ReactNode
transitionMode
"scaleUp"
"fade" | "scaleUp" | "unfold" | "fadeFromTop" | "fadeFromBottom" | "fadeFromLeft" | "fadeFromRight"
backdropType
"dark"
"dark" | "blur" | "transparent"
isModal
false
boolean
isDraggable
false
boolean
showCloseButton
true
boolean
closeOnEscape
true
boolean
The modern React component library.
© 2026 Lambda UI. Made with in Mexico by AletzMan.