Skip to content

Modal

Keeps a short, reversible task in focus without removing the person from the current context.

Design

Anatomy

1
1 Overlay (.ds-modal-overlay) — full-screen backdrop that blocks page interaction.
2 Container (.ds-modal) — elevated surface with border-radius and shadow.
3 Header (.ds-modal__header) — contains optional heading, description, and close button.
4 Title (.ds-modal__title) — linked via aria-labelledby.
5 Close button (.ds-modal__close) — dismisses the modal.
6 Body (.ds-modal__body) — scrollable content area.
7 Footer (.ds-modal__footer) — action buttons aligned right.

Interactive example · HTML/CSS/JS

Running with the stable ds-tis/modal JavaScript runtime.

Loading functional preview…

Sizes · HTML/CSS/JS

Three independent dialogs running with the stable HTML/CSS/JavaScript runtime.

Loading functional preview…

Custom body · HTML/CSS/JS

Public Form Field, Input, and Buttons composed inside the Web runtime.

Loading functional preview…

Token mapping

PropertyTokenCSS variable
overlay backgroundcomponent.modal.overlay.bg.default--ds-modal-overlay-bg-default
surfacesemantic.surface.elevated--ds-surface-elevated
overlay paddingcomponent.modal.overlay.padding.default--ds-modal-overlay-padding-default
overlay z-indexcomponent.modal.overlay.z-index.default--ds-modal-overlay-z-index-default
border-radiuscomponent.modal.radius.default--ds-modal-radius-default
shadowcomponent.modal.shadow.default--ds-modal-shadow-default
max-widthcomponent.modal.max-width.{sm,md,lg}--ds-modal-max-width-*
header spacingcomponent.modal.header.{padding-*,gap}.*--ds-modal-header-*-*
body spacing/typographycomponent.modal.body.{padding-*,font-size,line-height,font-weight}.*--ds-modal-body-*-*
description typographycomponent.modal.body.{font-size,line-height,font-weight}.*--ds-modal-body-*-*
title typographycomponent.modal.title.{font-size,line-height,font-weight,letter-spacing}.*--ds-modal-title-*-*
footer spacingcomponent.modal.footer.{padding-*,gap}.*--ds-modal-footer-*-*
close targetcomponent.modal.close.size.{sm,md,lg}--ds-modal-close-size-*
close iconcomponent.modal.close.icon-size.{sm,md,lg}--ds-modal-close-icon-size-*
close paddingcomponent.modal.close.padding.{sm,md,lg}--ds-modal-close-padding-*