XDSDialogHeader@xds/core · Dialog

Usage

Dialog displays a modal overlay that blocks interaction with the page until the user responds. Use it for delete confirmations, edit forms, terms acceptance, or any decision that should not be skipped. For cases where you want to show a dialog without managing open state, use the `useXDSImperativeDialog` hook — call `dialog.show(content)` and render `dialog.element` in your tree.

Best practices

GuidancePractices
DoChoose the right purpose: info for dismissable content, form to prevent accidental backdrop dismissal, required when the user must respond.
DoInclude a clear title in the header so users immediately understand what the dialog is asking.
DoUse purpose="form" for dialogs with inputs so the user can't accidentally lose data by clicking the backdrop.
DoKeep dialogs focused on a single task — if the content grows beyond what fits, consider a full page instead.
Don'tUse a dialog for simple messages that could be shown inline or as a toast notification.
Don'tNest dialogs inside other dialogs — restructure the flow into steps within a single dialog instead.
Don'tUse the fullscreen variant for simple confirmations — it is meant for complex content like editors or long forms.

Anatomy

ElementDescription
HeaderrequiredTitle, optional subtitle, and close button. The title receives focus on open for accessibility.
BodyrequiredThe main content area — text, forms, lists, or any layout.
FooterAction buttons like Save/Cancel or Accept/Decline, aligned to the end.
BackdroprequiredSemi-transparent overlay behind the dialog that blocks page interaction.

Import

ts
import {XDSDialogHeader} from '@xds/core/Dialog'

Props

PropTypeDescription
title
stringDialog title (receives focus on open).
subtitle
stringSubtitle below the title.
onOpenChange
(isOpen: boolean) => unknownClose button callback (no button if omitted).
startContent
ReactNodeContent before the title (e.g., a back button).
endContent
ReactNodeContent after the title, before close button.
hasDivider
boolean (default: true)Adds border at the bottom edge.

Showcase source

tsx
'use client';
import {XDSDialog, XDSDialogHeader} from '@xds/core/Dialog';
import {XDSLayout, XDSLayoutContent, XDSCard} from '@xds/core/Layout';
import {XDSText} from '@xds/core/Text';
export default function DialogHeaderShowcase() {
return (
<XDSDialog isOpen isInline onOpenChange={() => {}}>
<XDSLayout
header={
<XDSDialogHeader
title="Edit Profile"
subtitle="Update your personal information"
onOpenChange={() => {}}
/>
}
content={
<XDSLayoutContent>
<XDSCard variant="muted">
<XDSText type="body" color="secondary">
Dialog body content goes here.
</XDSText>
</XDSCard>
</XDSLayoutContent>
}
/>
</XDSDialog>
);
}