EXEPERTAI LAB

Research alpha

Time Machine
EXEPERTAI LAB
GALLERY / COLLECTION
← Browse Astryx gallery
Dialog·component·@astryxdesign/core

Dialog Header

Header for dialogs with a title, optional subtitle, close button, and start/end content slots.

Open in Playground @astryxdesign/core/Dialog

Showcases and examples

2 documented examples

Dialog Header

DialogHeader provides a structured header for dialogs with slots for title, subtitle, close button, and optional start or end content.

Preview loads on approachPreview loads on approach
Exact source · dialog-header-showcase
// Copyright (c) Meta Platforms, Inc. and affiliates.

'use client';

import {Dialog, DialogHeader} from '@astryxdesign/core/Dialog';
import {Layout, LayoutContent, Card} from '@astryxdesign/core/Layout';
import {Text} from '@astryxdesign/core/Text';

export default function DialogHeaderShowcase() {
  return (
    <Dialog isOpen isInline onOpenChange={() => {}}>
      <Layout
        header={
          <DialogHeader
            title="Edit Profile"
            subtitle="Update your personal information"
            onOpenChange={() => {}}
          />
        }
        content={
          <LayoutContent>
            <Card variant="muted">
              <Text type="body" color="secondary">
                Dialog body content goes here.
              </Text>
            </Card>
          </LayoutContent>
        }
      />
    </Dialog>
  );
}

Usage

Use DialogHeader to give a dialog a labelled title area and optional close control.

Typed props

PropType and behavior
titlestring
Dialog title (receives focus on open and labels the dialog via aria-labelledby).
subtitlestring
Subtitle below the title.
onOpenChange(isOpen: boolean) => unknown
Close button callback (no button if omitted).
startContentReactNode
Content before the title (e.g., a back button).
Slot: Icon
endContentReactNode
Content after the title, before close button.
Slot: Icon, Badge
endContentEdgeCompensation'inline' | 'block' | 'all'
Selects compensation axes for the end-content slot. Omit to preserve automatic close-action compensation.
hasDividerboolean · default true
Adds border at the bottom edge.

Anatomy

Header row · required

Arranges the title block, optional start/end content, and close control.

Start content · optional

Wraps optional leading content.

Title block · required

Groups the title and optional subtitle.

End content · optional

Groups optional trailing content with the optional close control.

Close icon · optional

Visual close glyph inside the close button.

Theming

Targets

astryx-dialog-header
astryx-dialog-header-start-content
astryx-dialog-header-title-block
astryx-dialog-header-end-content
astryx-dialog-header-close-icon