Playground

Interactive playground — toggle ModalTarget behavior, modal props, and the action you call, then run it live.

Playground

Tweak any option, hit Run, and see the result in real time. The two code panes show exactly what your action call and <ModalTarget> setup look like with the current configuration.

Modal props

Open options

ModalTarget behavior

Action call
openModal(DemoDialog, {
  group: 'demo',
  props: {"title":"Hello from playground","level":1}
})
  .then((data) => { /* confirmed */ })
  .catch(() => { /* closed */ })
Target setup
<ModalTarget group="demo" >
  <ModalOverlay class="vm-demo-overlay" />
</ModalTarget>

What you can change

  • ActionopenModal, replaceModal, or the useModal controller.
  • Modal propstitle and level passed to the demo dialog.
  • Open optionsinstantEnter to skip the enter animation.
  • ModalTarget behavior — every toggle from ModalBehaviorOptions: enableInteractOutside, disableCloseOnInteractOutside, disableCloseOnInteractOverlay, disableLockBodyScroll, disableCloseOnEscape.

The promise resolves when the user confirms (rendered in the demo dialog) and rejects when the modal closes — both outcomes show up in the Last result indicator.

Copyright © 2026