CSS
A modal is an overlay dialog that focuses the user’s attention on a specific task or content.
<div class="tng-modal"> <div class="tng-modal-panel"> <button class="tng-button is-tertiary is-ghost"> <span>Close</span> <i class="tng-icon icon-close" aria-hidden="true"></i> </button> <div class="tng-modal-content"> <div class="tng-slot is-primary"></div> </div> </div></div>Fullscreen
Section titled “Fullscreen”You can use the positioning utilities to create a fullscreen modal.
<div class="tng-modal | p-absolute at-maximum"> <div class="tng-modal-panel"> <button class="tng-button is-tertiary is-ghost"> <span>Close</span> <i class="tng-icon icon-close" aria-hidden="true"></i> </button> <div class="tng-modal-content"> <div class="tng-slot is-primary"></div> </div> </div></div>With Scroll
Section titled “With Scroll”When a modal contains potentially more content than fits in the viewport, you can use the overflow utility to make the content area scrollable. Keep the actions outside the scroller, or their touch targets add scroll.
<div class="tng-modal" style="max-block-size: 300px"> <div class="tng-modal-panel"> <button class="tng-button is-tertiary is-ghost"> Close <i class="tng-icon icon-close" aria-hidden="true"></i> </button> <div class="tng-overflow-scroll is-block"> <div class="tng-modal-content"> <p class="tng-text-body">…</p> <p class="tng-text-body">…</p> </div> </div> </div></div>With Image
Section titled “With Image”<div class="tng-modal"> <div class="tng-frame"> <div class="tng-slot"></div> </div> <div class="tng-modal-panel"> <button class="tng-button is-tertiary is-ghost"> Close <i class="tng-icon icon-close" aria-hidden="true"></i> </button> <div class="tng-modal-content"> <div class="tng-slot is-primary"></div> </div> </div></div>Recipes
Section titled “Recipes”Modal Dialog
Section titled “Modal Dialog”source code