Skip to main content Home
About About the Design SystemRoadmap
Get started OverviewDesignersDevelopers
Foundations OverviewColorGridIconographyInteractionsSpacingTypography
Tokens Overview Global colorbox shadowTypographyborderopacityspacelengthIconBreakpointsMedia Queries
Elements All elements Accordion Alert Announcement Audio player Avatar Back to top Badge Blockquote Breadcrumb Button Card Chip Code block Call to action Dialog Disclosure Footer Health index Icon Jump links Navigation (primary) Navigation (secondary) Pagination PopoverPlanned Progress stepsPlanned Site status Skip link Spinner Statistic Subnavigation Surface Switch Table Tabs Tag Tile Timestamp Tooltip Video embed
Theming OverviewColor PalettesCustomizingDevelopers
Patterns All PatternsCardTabsFilterFormLinkLink with iconLogo wallSearch barSkip navigationSticky bannerSticky cardTileVideo thumbnail
Personalization All Personalization PatternsAnnouncement
Accessibility FundamentalsAccessibility toolsAssistive technologiesCI/CDContentContributorsDesignDevelopmentManual testingResourcesScreen readers
Design/code status Release notes Get support

Dialog

OverviewStyleGuidelinesCodeAccessibilityDemos
StyleColor schemeSpaceInteraction statesStyleColor schemeSpaceInteraction states

Style

A dialog is a floating container on top of a transparent backdrop. The container requires a backdrop so it can separate itself from the page underneath. This helps users focus on the dialog content.

Anatomy

Anatomy of a dialog with lots of annotations pointing to various parts
  1. Backdrop
  2. Container
  3. Close button
  4. Header section
  5. Body text section
  6. Footer section
  7. Container shadow

Color scheme

Dialog is available for both light and dark color schemes.

Light color scheme

Light theme dialog

Dark color scheme

Dark theme badges

If a dialog element is a child of a dark scheme element, but the page as a whole uses the light scheme, the dialog should match the page scheme.


<body>
  <rh-surface color-palette="darkest"
              role="main">
    ... dark content
    <rh-card color-palette="lightest">
      ... light content
    </rh-card>
    <rh-dialog>
      This dialog inherits its color scheme from the main element.
    </rh-dialog>
  </rh-surface>
</body>

Place dialog elements in the root themable container to ensure they match the overall page color scheme.


<body style="color-scheme: dark only">
  <main>
    ... dark content
    <rh-card color-palette="lightest">
      ... light content
      <rh-dialog>
        Even though the whole page uses the dark color scheme,
        this dialog will always use the light color scheme,
        since it's a child of a themable container with the lightest
        color palette.
      </rh-dialog>
    </rh-card>
  </main>
</body>

Avoid placing dialogs in themable containers which don't match the page scheme

Space

The amount of space in a dialog reduces as breakpoints get smaller.

Large breakpoints

A dialog container on a large breakpoint with spacing between all elements

Small breakpoints

A dialog container on a small breakpoint with spacing between all elements

Interaction states

Interactive elements may be added to a dialog container, but very sparingly. If interactive elements are added, go to their element or pattern pages to view the interaction states.

Hover

Light theme dialog hover state example

Focus

Light theme dialog focus state example

Active

Light theme dialog active state example

© 2021-2025 Red Hat, Inc. Deploys by Netlify