by divbzero · 1y ago · 0 comments
File pickers:
<input type="file">
Color pickers: <input type="color">
Date/time pickers: <input type="month">
<input type="date">
<input type="time">
<input type="datetime-local">
Numeric sliders: <input type="range" min="0" max="5">
Suggested options for text fields: <input list="fonts">
<datalist id="fonts">
<option value="Courier New"></option>
<option value="Garamond"></option>
<option value="Georgia"></option>
<option value="Tahoma"></option>
<option value="Times New Roman"></option>
</datalist>
Summaries with expandable details: <h2>FAQs</h2>
<details name="faq">
<summary>Why are interactive HTML elements cool?</summary>
They’re lightweight and semantic!
</details>
<details name="faq">
<summary>Will the previous answer close when I open this one?</summary>
Yes, because the <code><details></code> elements share the same name.
</details>
Media players with controls: <audio controls src="example.mp3"></audio>
<video controls src="example.mp4"></video>Well some other comment mentioned audio/video and those are seemingly aways different
Which is probably fine for your users. In every browser it plays video and has basic controls like a start/pause button, a timeline and a volume control. While the video is playing they even look identical: it's the video, playing; with controls only visible on hover.
The differences aren't an issue for the actual user, they are an issue for the designer that tries to have the website look and feel the same everywhere. Preferably look the same as it does on their MacBook.
> <audio controls src="example.mp3"></audio>
> <video controls src="example.mp4"></video>
Which look different in every single browser and can't be styled without JavaScript. Wish these were implemented better.
And an unfortunate number of recreated controls seem to have the serious UX sins.
"looks different in every single browser" is a minor issue. Might be nice if they were restylable via CSS, though.