• CMSnpm version

    • Overview
    • ContentBuilder
    • InviteUserForm
    • LoginForm
    • RenewPasswordForm
  • UInpm version

    • Overview
    • Accordion
    • AlertBubble
    • AnnouncementBar
    • Avatar
    • AvatarFileInput
    • Badge
    • Button
    • ButtonGroup
    • ButtonList
    • Calendar
    • Checkbox
    • CheckboxButton
    • CheckboxInput
    • CheckboxList
    • Chip
    • ColorRadio
    • ColorRadioGroup
    • Combobox
    • DatePicker
    • DatePickerInput
    • DateRangePicker
    • DateRangePickerInput
    • DatetimePicker
    • DatetimePickerInput
    • Dialog
    • Dropdown
    • Dropzone
    • ErrorMessage
    • FileInput
    • FlashMessages
    • FormComponent
    • Icon
    • IconButton
    • ImageGallery
    • InfoBox
    • Input
    • Label
    • Layout
    • Lightbox
    • ListItem
    • Loader
    • Lozenge
    • Menu
    • Message
    • Modal
    • ✅ ModalDialog
    • ✅ ModalHeader
    • MultiCombobox
    • MultiSelect
    • Pagination
    • Paper
    • Popover
    • Radio
    • RadioGroup
    • RasterImage
    • Select
    • ✅ Tabs
    • TextInput
    • TextLink
    • Textarea
    • TimePicker
    • TimePickerInput
    • Toggle
    • Tooltip
    • Typography
  • Formnpm version

    • Overview
    • AvatarFileInput
    • CheckboxButton
    • CheckboxInput
    • CheckboxList
    • ColorRadioGroup
    • Combobox
    • DatePickerInput
    • DateRangePickerInput
    • DatetimePickerInput
    • Dropzone
    • FileInput
    • Form
    • FormRenderer
    • GpsInput
    • MoneyInput
    • MultiCombobox
    • MultiSelect
    • NumberInput
    • PasswordInput
    • RadioGroup
    • Select
    • TextInput
    • Textarea
    • TimePickerInput
    • Toggle
  • DataGridnpm version

    • Overview
    • DataGrid
    • DataGridCustomExample
    • ExportButton
    • FilterList
    • Filters
    • FiltersButton
    • FulltextInput
    • HiddenColumns
    • HiddenColumnsButton
    • Pagination
    • RowCounts
    • RowsPerPageSelect
    • SelectedRowsToolbar
    • TableV2
    • ToolbarControl
    • ToolbarCustoms
    • ToolbarTabs
  • Wysiwygnpm version

    • Overview
  • Resizernpm version

    • Overview
  • Routernpm version

    • Overview
  • Corenpm version

    • Overview
  • Core-Reactnpm version

    • Overview
  • Stylesnpm version

    • Overview
  • Localizenpm version

    • Overview
  • Analyticsnpm version

    • Overview
  • Datepickernpm version

    • Overview
  • Icons-generatornpm version

    • Overview
  • Smart-addressnpm version

    • Overview
  • E2Enpm version

    • Overview
  • E2E-Playwrightnpm version

    • Overview
View source on GitLab

Dialog

Low-level overlay primitive: a portalled, scroll-locked backdrop with a focus-trapped, centered panel. DialogPanel is the white rounded content container placed inside it.

When to use

Dialog is the lowest-level overlay in the family and expects Floating UI plumbing (context, getFloatingProps, a floating ref). Most code should not use it directly — reach for Modal / openModal (@uxf/ui/modal), which wraps Dialog, supplies that plumbing, and adds a controlled isOpen / onClose API plus the modal stack.

Use Dialog (or the useDialog hook) directly only for a bespoke overlay outside the modal stack. Use DialogPanel wherever you need the standard panel container — it is the usual child of a Modal.

Usage

The useDialog hook wires up Floating UI and returns everything Dialog needs. It lives in the same file but is not re-exported from index.ts, so import it from the file directly:

import { Button } from "@uxf/ui/button";
import { useDialog } from "@uxf/ui/dialog/dialog";

function Example() {
    const { openDialog, DialogProvider, closeDialog } = useDialog();

    return (
        <>
            <Button onClick={() => openDialog(<Button onClick={closeDialog}>Close</Button>)}>Open</Button>
            <DialogProvider />
        </>
    );
}

DialogPanel gives content the standard panel styling and width:

import { DialogPanel } from "@uxf/ui/dialog";

<DialogPanel width="sm">Panel content</DialogPanel>;

Props

Dialog

Imported from @uxf/ui/dialog.

Prop Type Default Description
isOpen boolean — (required) Whether the overlay is rendered.
context UseFloatingReturn["context"] — (required) Floating UI context (from useFloating).
forwardedRef Ref<HTMLDivElement> — (required) Floating element ref (refs.setFloating).
getFloatingProps (userProps?) => Partial<Record<string, unknown>> — (required) Floating UI interaction props getter.
children ReactNode — Overlay content, typically a DialogPanel.
variant DialogVariant "default" Visual variant (default, drawer-right).
className string — Extra class on the overlay.
style CSSProperties — Inline style on the overlay.

DialogPanel

Imported from @uxf/ui/dialog.

Prop Type Default Description
width DialogPanelWidth "default" Panel max-width (see below).
children ReactNode — Panel content.
className string — Extra class on the panel.

Variants & states

DialogVariant: default, drawer-right (right-anchored drawer on sm screens and up).

DialogPanelWidth maps to a max-width:

Width Max width
xs xs
sm sm
default lg
lg 3xl
xl 5xl

Requirements

Import the component stylesheet once in your global CSS:

@import url("@uxf/ui/css/dialog.css");

Also requires the global @uxf/ui token layer, set up once per app — see @uxf/ui setup.

Default
Open in new tab