Kitchen sink

Canonical markup for every pattern in @muchobien/ui. Copy from the page source. Classes, data-* values, elements and icons not shown here or listed in vocabulary.json don't exist.

Text

Body text with a link, inline code, ⌘ K, marked, strong, emphasis and small text.

Lists

  1. First step
  2. Second step

A quoted passage.

const answer = 42;
console.log(answer);
Deployments
Service Status Finished
api Running
web Stopped

Forms

Account 40%

Inputs keep 16px text so iOS doesn't zoom. Invalid fields turn red only after the user has edited them (:user-invalid).

Buttons

Dialog and popover

Open a dialog with command="show-modal" and a popover with popovertarget; neither needs script. A popover sits below the button that opens it.

Delete this project?

Its deployments and settings are removed. This can't be undone.

A popover closes when you click outside it or press Escape.

Details

What is a disclosure?

Content that shows when the summary is clicked.

Details that share a name form an accordion: opening one closes the others.

Which browsers are supported?

The latest Chrome and the latest iOS Safari.

Does it need JavaScript?

Only for the ui-* elements.

Components

Badge

Draft New Passed Pending Failed Beta

Notice

Start the text with what it is, so colour isn't the only signal.

Note: Builds run on every push to main.
New: Previews now deploy per branch.
Done: The project was created.
Warning: The certificate expires in 3 days.
Info: Maintenance is planned for Sunday.

Card

orbit

File sharing on the tailnet.

moonbase

The home server's services.

Toolbar and segmented control

Empty state

No deployments yet

Deployments appear here after the first push.

Layout

page centres the main column. stack spaces children vertically, cluster wraps them in a row, grid makes equal columns at least 16rem wide, and sidebar puts a 16rem column beside the content, stacking when narrow. visually-hidden hides text that screen readers still read.

Pinned scheme

data-theme pins a subtree to light or dark.

Always light.

Always dark.

Icons

Load icons.css and write <span class="icon" data-icon="name">. Icons take the text colour and size. Add aria-hidden="true" next to text, or role="img" and aria-label when the icon stands alone.

check x plus minus chevron-down chevron-up chevron-left chevron-right arrow-left arrow-right arrow-up arrow-down external-link copy trash-2 pencil search settings menu ellipsis info circle-alert triangle-alert circle-check circle-x loader-circle refresh-cw download upload link eye eye-off lock log-out user sun moon monitor git-branch git-pull-request git-commit-horizontal folder file calendar clock filter bell house

Custom elements

Load ui.js for these. Their markup is readable before the script runs.

ui-tabs

What the project is and who owns it.

ui-copy

pnpm add @muchobien/ui

ui-time

Deployed .

ui-table-sort

Projects
Name Requests Updated
orbit 1,204
lyra 98
moonbase 12,104

ui-toast

Put one ui-toast at the end of body and call show(message, variant).

ui-theme

The button in the header switches between light and dark. It writes <meta name="color-scheme"> and a color-scheme cookie; server-rendered pages read the cookie and write the meta tag themselves.