Skip to content

Modal

An independent React adapter where Ark UI provides the parts and Zag maintains focus, keyboard behavior, state, and outside-content blocking.

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 · Ark/Zag

Running with the independent Ark UI adapter and Zag behavior.

Loading functional preview…

Sizes · Ark/Zag

Three independent dialogs controlled by Ark UI parts and Zag behavior.

Loading functional preview…

Custom body · Ark/Zag

A real field-and-actions composition inside the Ark/Zag adapter.

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-*