- 2.1: packs/ -> archive/packs/ - 2.2: site/ -> archive/site/ - 2.3: src/lab/ -> archive/lab/ - 2.4: examples/ -> archive/examples-legacy/ (SSI-based)
28 lines
934 B
Markdown
28 lines
934 B
Markdown
---
|
|
title: "Dialog"
|
|
description: "Native HTML dialog element styled by ASW."
|
|
type: docs
|
|
weight: 36
|
|
date: 2026-04-11
|
|
tags: ["components", "dialog", "modal"]
|
|
ai-disclosure: "generated"
|
|
ai-model: "claude-sonnet-4-6"
|
|
ai-provider: "Anthropic"
|
|
---
|
|
|
|
ASW styles the native `<dialog>` element — no JavaScript modal libraries required. Call `dialog.showModal()` to open it. The `::backdrop` pseudo-element receives a semi-transparent overlay automatically.
|
|
|
|
## Inline Demo
|
|
|
|
<div data-demo>
|
|
<button onclick="document.getElementById('demo-dialog').showModal()">Open dialog</button>
|
|
<dialog id="demo-dialog">
|
|
<article>
|
|
<header><h3>Dialog title</h3></header>
|
|
<p>This is a native <code><dialog></code> element. ASW styles the backdrop and container automatically.</p>
|
|
<footer>
|
|
<button onclick="document.getElementById('demo-dialog').close()">Close</button>
|
|
</footer>
|
|
</article>
|
|
</dialog>
|
|
</div>
|