A shadcn-style dialog component built with Ark UI primitives.

Installation

npx shadcn@latest add @ark-cn/dialog

Usage

import * as Dialog from "@/components/ui/dialog"

Read exported parts in src/components/ui/dialog.tsx and compose the primitive according to the Ark UI pattern for this component.

Examples

Basic

Nested

Non Modal

Controlled

Initial Focus

Multiple Triggers

Inside Scroll

Outside Scroll

Confirmation

API reference

This component mirrors the upstream Ark UI primitive. All props and DOM behavior are defined by Ark unless you see an ark-cn-only row below.

DialogPopup

PropTypeDescription
backdropClassName?stringExtra class for the backdrop element.
bottomStickOnMobile?booleanBottom-aligned positioner on small screens instead of centered.
closeProps?CloseTriggerPropsProps forwarded to the built-in close button.
positionerClassName?stringExtra class on the positioner wrapper.
showCloseButton?booleanToggles the default close button.
size?"default" | "sm"Preset max-width for the content shell.

DialogFooter

PropTypeDescription
variant?"default" | "bare"Bordered/muted footer bar vs minimal padding only.

DialogPanel

PropTypeDescription
scrollFade?booleanApplies a vertical fade mask on scroll overflow.
scrollable?booleanEnables vertical scrolling with stable scrollbar gutter.

See the ARK UI documentation for the full API.

Accessibility

See the Ark UI documentation for clarification.