<bolt-modal>
in the markup to make it render. In the following examples, we use data-bolt-modal-target
to trigger the modal. However, the same options shown on the Usage Javascript page are also available on the web component.
<button type="button" class="e-bolt-button" data-bolt-modal-target=".js-bolt-modal-demo">
Open Modal
</button>
<bolt-modal class="js-bolt-modal-demo">
This is a modal.
</bolt-modal>
header
, default
, footer
. To pass content to either the header or footer, slot
must be defined.
<button type="button" class="e-bolt-button" data-bolt-modal-target=".js-bolt-modal-basic-demo">
Open Modal
</button>
<bolt-modal class="js-bolt-modal-basic-demo">
<bolt-text slot="header">This is the header</bolt-text>
<bolt-text>This is the body (default).</bolt-text>
<bolt-text slot="footer">This is the footer</bolt-text>
</bolt-modal>
<bolt-modal>
element. Use unique combinations to customize a modal to your liking.
<button type="button" class="e-bolt-button" data-bolt-modal-target=".js-bolt-modal-advanced-demo">
Open Modal
</button>
<bolt-modal width="optimal" spacing="none" theme="none" scroll="overall" class="js-bolt-modal-advanced-demo">
<bolt-image src="/images/content/backgrounds/background-robotics-customer-service.jpg" alt="This is an image"></bolt-image>
</bolt-modal>