• 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

ModalDialog

Ready-made dialog content layout: an icon + title header, body text, and a footer action row, wrapped in a DialogPanel.

When to use

Use ModalDialog as the content of a Modal / openModal (@uxf/ui/modal) when you need the standard alert / confirmation dialog structure (title, message, action buttons). It is higher-level than DialogPanel (@uxf/ui/dialog), which is only the panel container — ModalDialog fills that panel with the conventional header / body / footer layout.

For just the header row (back / close buttons, actions), see ModalHeader.

This directory has no index.ts, so import the component from its file: @uxf/ui/modal-dialog/modal-dialog.

Usage

import { Button } from "@uxf/ui/button";
import { Icon } from "@uxf/ui/icon";
import { closeModal, openModal } from "@uxf/ui/modal";
import { ModalDialog } from "@uxf/ui/modal-dialog/modal-dialog";

openModal({
    children: (
        <ModalDialog
            footer={
                <>
                    <Button onClick={() => closeModal()} variant="text">
                        Cancel
                    </Button>
                    <Button color="warning" onClick={handleConfirm}>
                        Confirm
                    </Button>
                </>
            }
            icon={<Icon color="warning" name="triangle-exclamation" />}
            title="Warning dialog"
        >
            Are you sure you want to continue?
        </ModalDialog>
    ),
});

ModalDialog renders its own DialogPanel, so pass it directly as the modal children — do not wrap it in another DialogPanel. Set isDialogPanelHidden to render the layout without the panel wrapper when it is already inside one.

Props

ModalDialogProps is not exported; these are the props the component accepts.

Prop Type Default Description
title string — (required) Header title.
children ReactNode — Body content. Rendered only when provided.
icon ReactNode — Leading icon in the header.
footer ReactNode — Footer action row (right-aligned). Rendered only when provided.
width DialogPanelWidth "xs" Width of the wrapping DialogPanel (xs, sm, default, lg, xl).
isDialogPanelHidden boolean false Render the layout without the DialogPanel wrapper.
className string — Extra class on the root element.

Requirements

Import the component stylesheet once in your global CSS:

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

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

Any Button / Icon passed via footer / icon also need their own stylesheets.

Default
Open in new tab