Skip to content

Modal - Web Component โ€‹

...

Browser support โ€‹

Detected engine: ย 

  • Chromium

  • Webkit

  • Gecko

Parameters โ€‹

The Web component uses the <z-modal> tag:

The parametrization of the component can be done with the following custom HTML params:

NameTypeDescription
contentstringContent of the modal.

The events emitted from the component are:

NamePayloadDescription
onchangebooleanReturns the new value of the "value" attribute

The available slots for the component are:

NameTagsDescription
defaultspan

Playground โ€‹

Customization โ€‹

HTML Examples โ€‹

Imports
html
<link rel="stylesheet" href="/0.4.5/@zurich/web-components/styles.css" />
<script type="module" src="/0.4.5/@zurich/web-components/modal.js"></script>
<script type="module" src="/0.4.5/@zurich/web-components/button.js"></script>
Code
html
<z-button id="button" z-button="primary" icon="arrow-diagonal:line">Open modal</z-button>
<z-modal id="modal">
  Lorem ipsum, dolor sit amet consectetur adipisicing elit. Et at commodi, debitis aliquam aperiam, odit libero
  rerum, error repudiandae magnam impedit neque nobis! Molestias, enim a rem quo velit facere.
</z-modal>