UNPKG

carbon-components

Version:

The Carbon Design System is IBM’s open-source design system for products and experiences.

41 lines (34 loc) 2.15 kB
<!-- Copyright IBM Corp. 2016, 2018 This source code is licensed under the Apache-2.0 license found in the LICENSE file in the root directory of this source tree. --> <button class="bx--btn bx--btn--primary" type="button" data-modal-target="#modal-up01x05l5qe">Show modal</button> <div data-modal id="modal-up01x05l5qe" class="bx--modal " role="dialog" aria-modal="true" aria-labelledby="modal-up01x05l5qe-label" aria-describedby="modal-up01x05l5qe-heading" tabindex="-1"> <div class="bx--modal-container"> <div class="bx--modal-header"> <p class="bx--modal-header__label bx--type-delta" id="modal-up01x05l5qe-label">Optional label</p> <p class="bx--modal-header__heading bx--type-beta" id="modal-up01x05l5qe-heading">Modal heading</p> <button class="bx--modal-close" type="button" data-modal-close aria-label="close modal" > <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bx--modal-close__icon" width="16" height="16" viewBox="0 0 32 32" aria-hidden="true"><path d="M24 9.4L22.6 8 16 14.6 9.4 8 8 9.4 14.6 16 8 22.6 9.4 24 16 17.4 22.6 24 24 22.6 17.4 16 24 9.4z"></path></svg> </button> </div> <!-- Note: Modals with content that scrolls, at any viewport, requires `tabindex="0"` on the `bx--modal-content` element --> <div class="bx--modal-content bx--modal-content--with-form" > <div class="bx--form-item"> <label for="text-input-up01x05l5qe" class="bx--label">Text Input label</label> <input id="text-input-up01x05l5qe" type="text" class="bx--text-input" placeholder="Optional placeholder text" data-modal-primary-focus> </div> </div> <div class="bx--modal-content--overflow-indicator"></div> <div class="bx--modal-footer"> <button class="bx--btn bx--btn--secondary" type="button" data-modal-close>Secondary button</button> <button class="bx--btn bx--btn--primary" type="button" >Primary button</button> </div> </div> <!-- Note: focusable span allows for focus wrap feature within Modals --> <span tabindex="0"></span> </div>