Site color

Choose your site’s color palette.

Saved on this device.

ModalTrigger

ModalTriggerDialog action

A clear invitation to a focused task. Connect a labelled native button to a matching dialog.

Layout & content

In context

A labelled next stepCOMPOSITION

Release review

Open a focused review without leaving your place in the document.

The target matches the dialog ID. Multiple triggers can open the same dialog and retain their own appearance.

<div class="component-recipe">
<h3>Release review</h3>
<p>Open a focused review without leaving your place in the document.</p>
<Flex wrap="true">
<ModalTrigger target="layout-trigger-review" label="Review release" tone="accent"/>
<ModalTrigger target="layout-trigger-review" label="Preview again" tone="neutral" variant="outline"/>
</Flex>
<Modal id="layout-trigger-review" title="Review release" :showClose="true">
<p>This dialog belongs to both triggers. Close it to return focus to the button you used.</p>
<template #footer>
<Btn tone="accent" data-modal-close>Done</Btn>
</template>
</Modal>
</div>

Open a review dialog

The target is the dialog ID without a hash. Close returns focus to the trigger.

A secondary trigger

More than one trigger can open the same dialog; each has its own label and treatment.

All semantic tones

All ten supported tones. A semantic palette communicates intent; visible labels keep the meaning explicit.

All semantic tonesCOMPOSITION
neutral
accent
feature
secondary
custom
ghost
info
success
warning
danger

Every value is visible. Compare treatments in the site’s light and dark themes.

All visual variants

All eighteen supported treatments, shown together.

All visual variantsCOMPOSITION
solid
surface
surfaceAlt
spotlight
glass
flat
flatAlt
flatSolid
outlineFill
outline
subtle
subtleBtn
link
sheen
underline
rail
bracket
none

Every value is visible. Compare treatments in the site’s light and dark themes.

Behavior and accessibility

ModalTrigger renders a native button. Enter and Space activate it. The standard modal runtime opens the target dialog, manages focus and handles Escape. A matching Modal must exist in the page.

API reference

ModalTrigger contract

Props below are the public template API. RefOrValue accepts a literal or a reactive ref; bind refs with a colon-prefixed attribute. Native attributes and events can be passed through the component root.

Composition

No slots. label supplies the text. Register defineModalComponents and defineButtonComponents. SSG includes the modal runtime when Modal is rendered.