Skip to content

Early previewhamur is not on npm yet. The components are being built in the open, follow along on GitHub.

UIComponentsReact

Dialog

A window over the page that holds the reader until it is closed.

Built on the headless Dialog.See its API in Docs

Rendered by React 19.3.1

dialog.tsx

Installation

npx shadcn@4.23.0 add https://hamur.dev/r/react/dialog.json

It also adds utils, button. The app needs its setup first: Installation.

Usage

DialogContent brings its own portal and overlay in React, Vue, Svelte and Solid, and a close button in the corner unless showCloseButton is false; in Angular the template writes uiDialogPortal and uiDialogOverlay itself. Open state, focus, Escape and outside clicks are the headless Dialog's: control it with open and its change event as the headless docs show.

import {
  Dialog,
  DialogClose,
  DialogContent,
  DialogDescription,
  DialogFooter,
  DialogHeader,
  DialogOverlay,
  DialogPortal,
  DialogTitle,
  DialogTrigger,
} from '@/components/ui/dialog'

Examples

Default

A trigger styled as an outline button, a title, a description and two actions.

Its preview and code are at the top of the page.

API reference

The styled parts pass every prop to the headless part they wrap and add classes. The props, data attributes and keyboard are on Dialog's API reference.