Design System

Dialog reference ​

Every prop, event, slot and rendered element, with what each one carries. For what a dialog is for, see Overview. For how to open one, see Usage.

CDialog is exported from @proxy-frontend/components.

Props ​

PropTypeRequiredDefaultMeaning
visiblebooleanYesNoneA two-way model, written v-model:visible. Whether the dialog is open
titlestringYesNoneThe accessible name of the dialog, and the header text when the header slot is not filled
widthsmall, medium, largeNoAbsent, which shrinks the dialog to fit its contentThe maximum width
closablebooleanNotrueWhether the close button, the Escape key and the click on the scrim are available
maximizablebooleanNofalseAdds a second header button that fills the window. No call site in the interface sets it

Events ​

EventPayloadDeclared by the component
update:visiblebooleanYes, by the model
showNoneNo. It arrives as a listener and is forwarded
hideNoneNo. It arrives as a listener and is forwarded
after-hideNoneNo. It arrives as a listener and is forwarded
maximizeEventNo. Reachable when maximizable is true
unmaximizeEventNo. Reachable when maximizable is true
dragstart, dragendEventNo, and unreachable. Dragging is switched off

Slots ​

SlotRenders intoNotes
defaultThe content regionScrolls when it runs out of room
headerThe left of the header bandReplaces the title text. The accessible name still comes from title
footerThe footer bandWhen the slot is absent the footer element is not rendered, and the bottom corners move to the content region
container, closeicon, maximizeiconNothingNot exposed. The component declares three templates and passes no others

Widths ​

ValueClassCapRendered width
AbsentNoneNoneShrinks to fit, up to 100vw - 32px
smallw-full max-w-dialog-sm400pxmin(100vw - 32px, 400px)
mediumw-full max-w-dialog-md600pxmin(100vw - 32px, 600px)
largew-full max-w-dialog-lg800pxmin(100vw - 32px, 800px)

There is no severity prop and no size prop. width is the shared size union under another name, as the vocabulary records.

Attributes ​

PassedReaches the dialog
data-*Yes
aria-*Yes, except aria-label, which the title prop overrides
A listenerYes
id, name, formYes
classNo
styleNo
A pass-through attribute such as pt:content:classNo

The component sets inheritAttrs to false and forwards through one allow-list, which is the filter Components describes for the layer.

Fixed behaviour ​

SettingValue
ModalTrue, so focus is trapped and the scrim is painted
DraggableFalse
Escape closesFollows closable
Click on the scrim closesFollows closable
Close button appearancecontrast severity, outlined, set as a module constant a caller cannot reach
Scroll behind the dialogNot blocked. The library asks the body to stop scrolling on every modal dialog, and it asks with a class that has no rule in the shipped stylesheets
Render targetThe end of document.body
StackingAn inline z-index on the scrim rather than a class. The library counts up from the modal base the application sets to the z-floating value of 100, so the first dialog paints at 101 and a later overlay sits above it

Rendered elements ​

ElementMarkerCarries
divdata-pc-section="mask"The fixed full-window scrim, 16px of inset, and the centring of the dialog
divrole="dialog", data-pc-section="root"Background, radius, maximum height and the width class
span twicedata-pc-section="firstfocusableelement", lastfocusableelementThe focus trap sentinels, hidden from assistive technology
divdata-pc-section="header"The header slot or the title, and the header actions
divdata-pc-section="headeractions"The maximise button when maximizable is set, then the close button when closable
buttondata-pc-group-section="headericon"A 14px glyph filled with the current colour
divdata-pc-section="content"The default slot, scrolling on the vertical axis
divdata-pc-section="footer"The footer slot, when that slot is filled

ARIA ​

AttributeValueSet by
roledialogThe component library
aria-modaltrueThe component library, from the fixed modal setting
aria-labelThe title propThe component, bound after the forwarded attributes, so it wins
aria-labelledbyAn identifier ending _headerThe component library. The element that would carry that identifier is never rendered, so the name comes from aria-label
aria-label on the close buttonCloseThe library locale default. It is outside the translation layer and stays in English

Geometry ​

PartValue
Scrim inset16px
Root radius6px on all four corners
Root maximum height90vh
Frame1px on each edge, assembled from the three regions and the bottom edge of the root
Header padding16px on all sides
Header height with closable64px, set by the 32px close button
Header height with closable false56px, set by the 24px title line box
Content padding0 top, 16px left, right and bottom
Footer padding0 top, 16px left, right and bottom
Footer gap8px
Header action gap4px
Close and maximise button32px square, 6px radius, 1px border, 14px glyph
Title roletext-title, which renders at 18px on a 24px line at weight 600

Colour ​

PartToken
Dialog backgroundsurface-page
Footer backgroundsurface-page
Every borderline-default
Header, content and footer textfg-default
Header button glyphfg-muted
Header button hover backgroundfg-strong at 15 per cent
ScrimBlack at 40 per cent

What does not paint ​

Written on the elementEffect
shadow-lg on the rootNone. The shadow scale is cleared, and no rule for the class ships
The transition wrapper around the rootNone. No matching enter or leave rules ship, so there is no animation
transition-all duration-300 on the scrimNone. The scrim is mounted and unmounted rather than transitioned
has-[.mask-active]:bg-transparent on the scrimNone. The selector needs a mask-active descendant, and the drawer preset rather than the dialog preset is what adds one
!top-0 !left-0 when maximisedNone. The root is not positioned
The preset section for the titleNone. The element it targets is never rendered, so the title class comes from the component itself