ModalTrigger

A labelled button that opens a matching Modal through the standard dialog runtime.

ModalTrigger

View source ยท API reference

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.

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.