- Native functionality that could have been implemented via CA
- Global attributes
- Form control attributes
- Tables
- Code
- Media elements
- Other
The use cases on a high level are outlined in the explainer. This document is to list very specific, concrete use cases.
- The
listattribute of<datalist>for autocomplete - The
titleattribute for tooltips - Popover API
- Invokers
- Add icon (
prefix="icon-name"/suffix="icon-name") - Skeleton (e.g.
<p loading-placeholder="3 sentences">) - Tooltip (
tooltip="...") - Data binding
<input id="slider" type=range sync-with="slider-value">
<input id="slider-value" type=number sync-with="slider">- Highlight matches within (e.g.
highlight="foobar") removable(adds X button that removes the element and fires a suitable event)- Conditional rendering (
show-if,hide-if,remove-ifetc) - Emulate events for test framework (e.g.
click-after="0.5") - LIterally all htmx attributes
- Persisting forms (e.g. in local storage)
- Custom form validation
required-trimmed: Likerequired, but whitespace-only values don't count- Show/hide password
- Checkboxes
- Designate a checkbox as an aggregate checkbox for checkboxes with a given
name- Or a
<progress>element
- Or a
indeterminateattribute
- Designate a checkbox as an aggregate checkbox for checkboxes with a given
- Text inputs
- Specific format, e.g. currency, measurement, 5-digit code, etc
<button><button href>- Disable button if field is invalid (or form)
<table sortable><td value>to be used for filtering and sorting
<pre src>for loading and highlighting a file<pre editable>for code editors (or any other element)<pre normalize-whitespace>
- HTMLMediaElement (
<audio>and<video>)- Custom toolbar
start-at="0:05"lazy-src
- Images
- Click to play (with separate
srcfor the static frame)
- Click to play (with separate
formatattribute on<time>,<data>for presenting data with custom formats