GitHub, 7 stars
Light themes
Dark themes

Make your own

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.

Screens, 8 minutes

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.

Components, 7 minutes

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.

Components, 7 minutes

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.

CSS and themes, 6 minutes

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.

Components, 7 minutes

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.

Components, 7 minutes

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.

How Tray UI is made, 7 minutes

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.

CSS and themes, 7 minutes

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.

Components, 7 minutes

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.

Components, 7 minutes

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.

Components, 8 minutes

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.

Components, 8 minutes

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.

Open the feed

GitHub7 stars

↑↓ to moveEnter to openEsc to close