Articles, page 4
How to build the parts of an interface in plain HTML, CSS and JavaScript, accessible from the start, worked through with the code of Tray UI.
Empty states that say what to do next
Empty states for a first use, a search with no results, filters that hide everything, an error and no access: one action each, and a count that is read.
A slider that says its unit with aria-valuetext
A native range input that says "30 km" where it would say "30": aria-valuetext, a visible value, words for the steps, the keys, and Tray UI's slider.
A paginated data table that keeps focus
A sortable, paged data table in plain HTML that keeps focus where the person is, says each new sort and page aloud, and stays a real table throughout.
An SVG icon sprite inside one script
Build an SVG sprite of symbol elements from a script, draw each icon with use and currentColor, hide it from screen readers and flip arrows right to left.
A one-time code input with paste and autofill
A one-time code field that takes a typed code, a pasted one and SMS autofill: one-time-code, inputmode, cells or one field, and why one field can be better.
Show password: aria-pressed or a new label
A show password button in HTML: a constant name with aria-pressed, or a name that changes to Hide password. What each says, and which Tray UI uses where.
Open Graph images from HTML with Playwright
Draw a 1200 by 630 link picture for every page: an HTML template for each kind of page, a Playwright screenshot, a cache that redraws only what changed.
Self-hosting a web font with one woff2 file
Self-host a variable font from one woff2 file: the @font-face rule, font-display, a preload with crossorigin, CORS for other sites and the OFL licence.
An accessible product tour that closes on Escape
A product tour in HTML and JavaScript: non-modal steps that point at the page, move focus with each step, close on Escape, can be skipped and hand focus back.
An accessible carousel that keeps focus at its end
A carousel in HTML, CSS and JavaScript: buttons that stop at the ends without losing focus, slide names, no autoplay or a pause, and reduced motion.
How to build an accessible dropdown menu in HTML
A menu button in plain HTML and JavaScript: the ARIA roles, the keys, where focus goes, how it closes, and the events, with Tray UI's menu as the example.
Toast notifications that screen readers announce
How to make toast notifications that screen readers announce: a live region in the page first, polite or assertive, timing, focus and reduced motion.
Articles 38 to 49 of 50
New articles in a feed
Add the Atom feed to a feed reader, and each new article comes to you whole, with its code.