The <datalist> element sets recommended values for an
<input> element. Browsers may show a dropdown menu of all values
or match values as the user types.
The element is actually supported since a very long time,
but Firefox and Safari do not support all features or have some bugs (only partial support).
This is tracked by Can I use.
By default the <dialog> can be closed via the close buttons and
Esc.
You cannot dismiss it by clicking outside of the dialog (light dismiss).
The closedby attribute can change that behavior.
The <meter> element represents a scalar value within a known range
or a fractional value.
The alternate name for this is gauge.
Can be used to show disk usage, battery, ratings, etc.
The meter element should not be used to indicate progress.
Use the <progress> element for that.
The <details> element is a disclosure widget which can be expanded
to reveal additional content. When closed, only the nested <summary> element is visible.
A summary here
A long-winded text that is hidden when you click on the summary.
Multiple <details> elements which use the same name attribute are
mutually exclusive.
When one member of the group is opened, all other members are closed.
Element one
Hidden text for one.
Element two
Hidden text for two.
Html Input Components
Range Slider
<input type="range"> elements let the user specify a numeric value
which must be no less than a given value, and no more than another given value.
A <datalist> can provide a list of predefined values
to suggest to the user for this input.
The command and commandfor attributes
for the <button> HTML
element dispatch an action to an element when the button is invoked (by click or keystroke), as a
declarative alternative to addEventListener() calls or onclick attribute
handlers.
Can be used to pair html components.
The following commands are possible:
"show-modal"
"close"
"request-close"
"show-popover"
"hide-popover"
"toggle-popover"
Custom values, prefixed with two hyphen characters "--" will be
dispatched on the controlled element.
As OpenUI explainscommand/commandfor
do replicate popovertarget’s functionality, the
two will co-exist side by side
for some while to enable a smooth transition.
It is, however, intended that commandfor will replace
popovertarget leading to popovertarget’s eventual deprecation.
If an element also has both a popovertarget and the command/commandfor attributes set,
then popovertarget must be ignored: command takes precedence.
The popover HTML attribute creates an overlay to display content on top of other page content.
Popovers can be shown declaratively using HTML, or using the
showPopover() method.
While popovertarget sufficiently captured the use case for popovers,
it fell short of providing the same developer & user experience for other interactive elements such as
<dialog>.
This is addressed with the invoker commands.
<button popovertarget="mypopover">Toggle the popover</button>
<div id="mypopover" popover>Popover content</div>
Results in this:
Popover content
Html Image Components
Html has a lot of great built-in image components.
Lazy-loading images and iframes
The loading="lazy" attribute for <img>
and <iframe> elements blocks loading the external resource
until the user scrolls to that element's part of the page.
Web Components can add components to html that are not there yet.
You can use the available Apis to write one yourself,
use a community-supplied standalone (see below)
or use a web component library: