A moment of focus.
Use a modal only when a task needs a focused decision.
Interactive example
This example uses the native dialog element and components.js. Escape closes it. Both actions only dismiss the example.
Code
<button class="sk-button" type="button" data-open-dialog="example-dialog">Open example dialog <span aria-hidden="true">↗</span></button><dialog class="sk-dialog" id="example-dialog" aria-labelledby="example-dialog-title"><span class="eyebrow">Design system / Example</span><h2 id="example-dialog-title">Keep the decision clear.</h2><p>Native dialogs contain keyboard focus, support Escape and return focus to the control that opened them.</p><div class="button-row"><button class="sk-button" type="button" data-close-dialog>Done</button><button class="sk-button secondary" type="button" data-close-dialog>Cancel</button></div></dialog>Usage
- Include a visible title and an explicit dismiss or cancel action.
- Place initial focus deliberately; for destructive actions, choose a safe starting point.
- Do not place a modal inside another modal.
- For irreversible actions, state the object and consequence before confirmation.

