Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- The demo page shows what 0.2.0 added: a `<details>` dropdown in the header nav, a link that opens a closed FAQ answer, a link that selects a tab, a Share button (`command="--share"`), search results from a hidden list with a Ctrl+K shortcut, select-all checkboxes, a plain number column lined up on the right, a filter kept in the address (`name="q"`) with its highlight and "No matches" line, a remembered sort (`data-tag-remember` on the table), a confirm-password field (`data-tag-match`), help text after a password field, an image file input with thumbnails, a red Delete in the confirm dialog, and two pictures in one figure that the viewer steps through. It now loads TagBrush.css 2 (`tagbrush@2`), which styles the header dropdown, tabs, selected rows, and toggle buttons these use.

## 0.2.0 (2026-11-12)

Behaviors for the patterns TagBrush.css gained (dropdowns from `<details>`, the phone menu), and things visitors expect on any site.
Expand Down
72 changes: 51 additions & 21 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>TagAction: plain HTML that behaves</title>
<meta name="description" content="A tiny script that makes semantic HTML tags behave the way people expect. No classes, no build step, no page script.">
<link rel="icon" href="https://kovirlabs.github.io/tagstack/mark.svg" type="image/svg+xml">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tagbrush@1/tagbrush.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tagbrush@2/tagbrush.min.css">
<link rel="stylesheet" href="https://kovirlabs.github.io/tagstack/brand.css">
<script src="tagaction.min.js"></script>
</head>
Expand All @@ -26,6 +26,16 @@
<strong>TagAction</strong>
<ul>
<li><a href="#install">Install</a></li>
<li><details><summary>Examples</summary>
<ul>
<li><a href="#tables">Tables</a></li>
<li><a href="#forms">Forms</a></li>
<li><a href="#dialogs">Dialogs and menus</a></li>
<li><a href="#faq">Details</a></li>
<li><a href="#tabs">Tabs, copy, and theme</a></li>
<li><a href="#images">Images</a></li>
</ul>
</details></li>
<li><button class="outline" aria-expanded="false" aria-controls="guides">Guides</button>
<ul id="guides">
<li><a href="https://github.com/kovirlabs/tagaction#readme">README</a></li>
Expand All @@ -46,33 +56,52 @@ <h1>Plain HTML that behaves</h1>
<h2 id="install">Install</h2>
<p>Add one line to <code>&lt;head&gt;</code>. Copy it with the button.</p>
<pre><code>&lt;script src="https://cdn.jsdelivr.net/npm/tagaction@0/tagaction.min.js" defer&gt;&lt;/script&gt;</code></pre>
<p>Released <time datetime="2026-11-06T17:00Z" data-tag-time="relative">November 6, 2026</time>. Times with a timezone, like <time datetime="2026-11-06T17:00Z">17:00 UTC</time>, show in your own. Tap <abbr title="Progressive enhancement">PE</abbr> on a phone to read it.</p>
<p>Released <time datetime="2026-11-06T17:00Z" data-tag-time="relative">November 6, 2026</time>. Times with a timezone, like <time datetime="2026-11-06T17:00Z">17:00 UTC</time>, show in your own. Tap <abbr title="Progressive enhancement">PE</abbr> on a phone to read it. Using htmx? <a href="#faq-htmx">It works with it</a>: the link opens the answer below.</p>
<p><a id="release-notes" href="https://github.com/kovirlabs/tagaction/blob/main/CHANGELOG.md">Release notes for 0.2.0</a> <button class="secondary" commandfor="release-notes" command="--share" hidden>Share</button></p>
<search><input type="search" aria-label="Search the examples" aria-controls="example-pages" aria-keyshortcuts="Control+K Meta+K" placeholder="Search the examples… (Ctrl+K)" hidden></search>
<ul id="example-pages" hidden>
<li><a href="#tables">Sortable, filterable tables</a></li>
<li><a href="#forms">Form validation messages</a></li>
<li><a href="#forms">Password confirmation</a></li>
<li><a href="#forms">Live totals with output</a></li>
<li><a href="#dialogs">Dialogs and dropdown menus</a></li>
<li><a href="#faq">Accordions that remember</a></li>
<li><a href="#tabs">Tabs</a></li>
<li><a href="#tabs">Copy and share buttons</a></li>
<li><a href="#tabs">Light and dark switch</a></li>
<li><a href="#images">Image viewer</a></li>
</ul>

<h2>Tables</h2>
<p>Click a column header to sort. Type to filter.</p>
<search><input type="search" aria-label="Filter orders" aria-controls="orders" aria-keyshortcuts="/" placeholder="Filter orders… (press /)" hidden></search>
<table id="orders">
<thead><tr><th>Customer</th><th>Total</th><th>Placed</th><th>Status</th></tr></thead>
<h2 id="tables">Tables</h2>
<p>Click a column header to sort; the order is kept when you come back. Type to filter: matches are highlighted, the filter goes into the address so you can share it, and a line under the table says when nothing matches. Columns of numbers line up on the right. Check the header box to select every shown row, or Shift-click a range.</p>
<search><input type="search" name="q" aria-label="Filter orders" aria-controls="orders" aria-keyshortcuts="/" placeholder="Filter orders… (press /)" hidden></search>
<table id="orders" data-tag-remember>
<thead><tr><th><input type="checkbox" aria-label="Select all"></th><th>Customer</th><th>Items</th><th>Total</th><th>Placed</th><th>Status</th></tr></thead>
<tbody>
<tr><td>Maya Lin</td><td><data value="1240">$1,240.00</data></td><td><time datetime="2026-11-02">Nov 2</time></td><td><mark data-tone="success">Paid</mark></td></tr>
<tr><td>Alex Chen</td><td><data value="95">$95.00</data></td><td><time datetime="2026-10-28">Oct 28</time></td><td><mark data-tone="warning">Pending</mark></td></tr>
<tr><td>Zoë Park</td><td><data value="310.5">$310.50</data></td><td><time datetime="2026-11-05">Nov 5</time></td><td><mark data-tone="success">Paid</mark></td></tr>
<tr><td>Bo Ito</td><td><data value="18">$18.00</data></td><td><time datetime="2026-09-14">Sep 14</time></td><td><mark data-tone="error">Refunded</mark></td></tr>
<tr><td><input type="checkbox" aria-label="Select Maya Lin"></td><td>Maya Lin</td><td>12</td><td><data value="1240">$1,240.00</data></td><td><time datetime="2026-11-02">Nov 2</time></td><td><mark data-tone="success">Paid</mark></td></tr>
<tr><td><input type="checkbox" aria-label="Select Alex Chen"></td><td>Alex Chen</td><td>1</td><td><data value="95">$95.00</data></td><td><time datetime="2026-10-28">Oct 28</time></td><td><mark data-tone="warning">Pending</mark></td></tr>
<tr><td><input type="checkbox" aria-label="Select Zoë Park"></td><td>Zoë Park</td><td>4</td><td><data value="310.5">$310.50</data></td><td><time datetime="2026-11-05">Nov 5</time></td><td><mark data-tone="success">Paid</mark></td></tr>
<tr><td><input type="checkbox" aria-label="Select Bo Ito"></td><td>Bo Ito</td><td>2</td><td><data value="18">$18.00</data></td><td><time datetime="2026-09-14">Sep 14</time></td><td><mark data-tone="error">Refunded</mark></td></tr>
</tbody>
</table>

<h2>Forms</h2>
<p>Submit with mistakes to see messages under the fields. Ctrl+Enter (⌘+Enter) in the bio sends the form too. Choose several files, or drop them on the label.</p>
<h2 id="forms">Forms</h2>
<p>Submit with mistakes to see messages under the fields. The second password must match the first. Ctrl+Enter (⌘+Enter) in the bio sends the form too. Choose several files, or drop them on the label; pictures show a thumbnail.</p>
<form action="https://example.com/signup" method="post">
<label for="email">Email</label>
<input type="email" id="email" name="email" required>
<small>We never share it.</small>
<label for="password">Password</label>
<input type="password" id="password" name="password" required minlength="8">
<small>At least 8 characters.</small>
<label for="confirm-password">Confirm password</label>
<input type="password" id="confirm-password" name="confirm-password" required data-tag-match="password">
<label for="bio">Short bio</label>
<textarea id="bio" name="bio" maxlength="160"></textarea>
<label for="files">Attachments</label>
<input type="file" id="files" name="files" multiple>
<label for="avatar">Profile photo</label>
<input type="file" id="avatar" name="avatar" accept="image/*">
<label for="room">Room</label>
<select id="room" name="room"><option value="120">Standard ($120)</option><option value="180">Suite ($180)</option></select>
<label><input type="checkbox" id="breakfast" name="breakfast" value="15"> Breakfast ($15)</label>
Expand All @@ -92,26 +121,26 @@ <h3>Guests</h3>
</div>
</form>

<h2>Dialogs and menus</h2>
<h2 id="dialogs">Dialogs and menus</h2>
<p>The button opens the dialog with no script. Click the backdrop to close it.</p>
<button commandfor="confirm" command="show-modal">Delete project</button>
<dialog id="confirm">
<form method="dialog">
<header><h3>Delete project?</h3><button aria-label="Close">✕</button></header>
<p>This removes every file. It can't be undone.</p>
<footer><button class="secondary" value="cancel">Cancel</button><button value="delete">Delete</button></footer>
<footer><button class="secondary" value="cancel">Cancel</button><button value="delete" data-tone="error">Delete</button></footer>
</form>
</dialog>

<h2>Details</h2>
<p>These answers open one at a time, and the page remembers which one was open.</p>
<h2 id="faq">Details</h2>
<p>These answers open one at a time, and the page remembers which one was open. A link to an answer opens it, and a printout includes every answer.</p>
<section data-tag-remember>
<details name="faq" id="faq-js"><summary>Does it work without JavaScript?</summary><p>Yes. Every page works plainly; TagAction only adds behavior.</p></details>
<details name="faq" id="faq-htmx"><summary>Does it work with htmx?</summary><p>Yes. Content swapped in later is enhanced automatically.</p></details>
</section>

<h2>Tabs, copy, and theme</h2>
<p>Tabs show one panel at a time; arrow keys move between them. Without JavaScript, every panel shows.</p>
<h2 id="tabs">Tabs, copy, and theme</h2>
<p>Tabs show one panel at a time; arrow keys move between them. Without JavaScript, every panel shows. A link to a panel selects its tab: <a href="#tab-npm">install from npm</a>.</p>
<div role="tablist" aria-label="Install with">
<button role="tab" aria-controls="tab-cdn" aria-selected="true">CDN</button>
<button role="tab" aria-controls="tab-npm">npm</button>
Expand All @@ -122,10 +151,11 @@ <h2>Tabs, copy, and theme</h2>
<div role="group"><input id="demo-invite" value="https://example.com/join/4F7Q" readonly><button commandfor="demo-invite" command="--copy" hidden>Copy</button></div>
<p><select data-tag-theme aria-label="Color scheme" hidden><option value="">Auto</option><option value="light">Light</option><option value="dark">Dark</option></select></p>

<h2>Images</h2>
<h2 id="images">Images</h2>
<figure>
<a href="https://picsum.photos/id/1015/1600/900.jpg"><img src="https://picsum.photos/id/1015/800/450.jpg" alt="A river between mountains" width="800" height="450" loading="lazy"></a>
<figcaption>Click to see it larger.</figcaption>
<a href="https://picsum.photos/id/1018/1600/900.jpg"><img src="https://picsum.photos/id/1018/800/450.jpg" alt="Mountain ridges above a forest" width="800" height="450" loading="lazy"></a>
<figcaption>Click a picture to see it larger; the arrow keys step through both.</figcaption>
</figure>
</article>
</main>
Expand Down
Loading