Backdrop
RequiredFull-viewport overlay separating the dialog from page content.
Overlays
A ready-made animated modal dialog for a short focused task or decision.
DialogDialogPropsDialogSizeConfigure the production component, inspect it at responsive widths, copy synchronized JSX, and share the exact state from one workspace.
This JSX stays synchronized with the controls and uses only public package APIs.
'use client';
import { useState } from 'react';
import { Button, Dialog } from '@ai-created/ui';
export function Example() {
const [open, setOpen] = useState(false);
return (
<>
<Button onClick={() => setOpen(true)}>Open dialog</Button>
<Dialog
open={open}
onClose={() => setOpen(false)}
title={"Rename project"}
>
<p>Dialog content belongs here.</p>
</Dialog>
</>
);
}
import { Dialog } from '@ai-created/ui';Client boundary
'use client' to the file that owns this interactive state.Replace the version placeholder with the release tag your product has reviewed.
npm install --install-links "git+https://github.com/TheMarco/ai-created-ui.git#vX.Y.Z"@import '@ai-created/ui/styles/tokens.css';
@tailwind base;
@tailwind components;
@tailwind utilities;module.exports = {
presets: [require('@ai-created/ui/tailwind-preset')],
content: [
'./src/**/*.{js,ts,jsx,tsx,mdx}',
'./node_modules/@ai-created/ui/src/**/*.{js,ts,jsx,tsx}',
],
};Named regions define what belongs to the component, what remains optional, and where semantic responsibility lives.
Full-viewport overlay separating the dialog from page content.
Centered bounded content surface.
Optional title, description, and close button.
44 × 44px labelled dismiss button.
buttonConsumer task content.
The Figma-equivalent asset model, auto-layout, resizing, properties, slots, content bounds, localization, and governance contract.
Asset kind
component
Design library name
Components/Overlays/Dialog
Maturity
stable
Last reviewed
2026-08-29
Canvas applicability
Publish size variants with open state, title, description, and nested body content.
| Property | Type | Default | Code mapping | Options or notes |
|---|---|---|---|---|
| OpenRequired | boolean | false | open | No additional constraint |
| Size | variant | md | size | sm, md, lg, xl |
| Title | text | None | title | No additional constraint |
| Description | text | None | description | No additional constraint |
| ContentRequired | slot | None | children | No additional constraint |
Full viewport modal overlay.
Internal fixed overlayFocused dialog surface.
Headless UI DialogPanelTitle, description, and close action.
Internal headerFocused task content.
childrenOverflow: Wrap; do not truncate.
Users need a concise task name.
Overflow: Move long instructions into the body.
Header copy should orient, not explain the whole task.
Overflow: Move complex multi-section work to a page.
Dialogs interrupt the underlying workflow.
Translatable: Title, Description, Body, Action labels
Width is capped by size and inset 16px from the viewport.
No internal breakpoint
Accountable owner
Design systems overlay primitive owner
Canonical source: src/components/Dialog.tsx
These measurements and semantic tokens define the supported visual contract. Local overrides should preserve the same hierarchy and interaction cues.
Viewport padding
16px
Panel max width
384 / 512 / 672 / 896px
sm / md / lg / xl.
Radius
6px
Header padding
20px horizontal mobile / 24px md; 12px vertical
Body padding
24px horizontal / 20px vertical
Close target
44 × 44px
Close glyph
24 × 24px
Close glyph inset
16px from top and logical end
The target is positioned independently so it does not make a title-only header taller.
--color-overlayBackdrop.
--color-surfacePanel.
--color-borderPanel and header divider.
--color-text / --color-text2 / --color-text3Title, description, and close icon.
--color-focusClose focus outline.
A component is not complete until its passive, interactive, disabled, and exceptional states remain understandable in both themes.
Semantics, accessible naming, keyboard behavior, focus and announcements are implementation requirements, not optional documentation.
Use the public package API and preserve the controlled-state, native-attribute, and ref contracts described below.
import { Dialog } from '@ai-created/ui';Client Component required
<Dialog open={open} onClose={() => setOpen(false)} title="Rename project">...</Dialog>These props and helpers are compatibility contracts. Changes require migration guidance and release notes.
| Prop | Type | Default | Contract |
|---|---|---|---|
| open | boolean | required | Whether the dialog is shown. |
| onClose | () => void | required | Called on dismissal. |
| title | string | undefined | Optional accessible title. |
| description | string | undefined | Optional description. |
| size | DialogSize | md | sm, md, lg, or xl. |
| children | ReactNode | required | Dialog content. |
These rules keep the component recognizable across products without preventing deliberate composition.
The component should be verified as rendered UI, an interaction model, an accessibility surface, and a theme-aware visual artifact.