Components

Utilities

7 components. Every one is themeable, keyboard operable, and configurable by data attribute, JSON or JavaScript.

Utilities

Command Palette

A keyboard-first jump list over everything on the page.

command-palettedefaultopenresultsempty

Preview

Palette

Usage

Props

PropTypeDefaultDescription
items array [] [{ label, href, group?, icon?, shortcut? }]
triggerLabel string "Search" Text on the opening control.
hotkey string "k" Opens with Cmd/Ctrl + this key. Set to "" to disable.
placeholder string "Jump to…" Example value in the field.
emptyText string "Nothing matches that" Shown when the filter excludes everything.

Accessibility

  • A native <dialog> with showModal(), so the focus trap, the top layer and Escape are the platform's rather than hand-rolled.
  • The field is a combobox with aria-activedescendant: focus stays in the input while arrow keys move the highlighted option.
  • Focus returns to the trigger on close, and the hotkey never fires while someone is typing in another field.

Design tokens

--lb-surface --lb-outline --lb-elev-modal --lb-surface-3

Utilities

Language Switcher

Switch locale, with each language named in its own language.

language-switcherdefaultopenselectedempty

Preview

Three languages

Usage

Props

PropTypeDefaultDescription
items array [] [{ code, label, href }] where label is the endonym.
current string — Code of the language now showing.
label string "Language" Accessible name for the control.
variant string "menu" Visual treatment. All variants share one behaviour and one API.
One of: menu, row

Accessibility

  • Each option carries lang and hreflang, so a screen reader pronounces "Português" in Portuguese rather than in English.
  • The current language is marked with aria-current and a check, not by colour.
  • The menu follows the APG pattern: Escape closes it and focus returns to the trigger.

Design tokens

--lb-surface --lb-outline --lb-elev-popover

Utilities

QR Code

A scannable code for the page, generated in the browser with no network call and no dependency.

qr-codedefaulterror

Preview

A link

Usage

Props

PropTypeDefaultDescription
value string — What the code encodes. Defaults to the current page URL.
size number 180 Rendered width in pixels.
label string — Caption beneath the code.
quiet number 4 Quiet-zone width in modules. Below 4 the code may not scan.
downloadable boolean true Adds a control that saves the code as an SVG.

Accessibility

  • The code is an image with an accessible name stating what it encodes, so a screen-reader user is not told only "QR code".
  • The encoded value is also rendered as selectable text, because a QR code is unusable to anyone reading the page on the device that would scan it.
  • Drawn as SVG with theme tokens, so it stays legible in dark mode instead of inverting into an unscannable negative.

Design tokens

--lb-surface --lb-on-surface --lb-outline

Utilities

Share Widget

Native sharing where the device offers it, and a labelled list of destinations where it does not.

share-widgetdefaultopencopied

Preview

Button
Row

Usage

Props

PropTypeDefaultDescription
url string — What to share. Defaults to the current page.
title string "Share" Button and dialog text.
text string — Message pre-filled where the target supports it.
targets array ["x","bluesky","whatsapp","telegram","email"] Fallback destinations in order.
variant string "button" Visual treatment. All variants share one behaviour and one API.
One of: button, row

Accessibility

  • Each destination is a named link, so "Share on Bluesky" is announced rather than a bare logo.
  • The native share sheet is used when available, which is the accessible path the platform already maintains.

Design tokens

--lb-surface --lb-outline-strong

Utilities

Theme Toggle

One control showing the mode it will switch to, with an optional three-way choice.

theme-toggledefaulthoverfocusselected

Preview

Toggle
Segmented

Usage

Props

PropTypeDefaultDescription
variant string "button" A single toggle, or an explicit light/dark/auto choice.
One of: button, segmented
label string "Switch theme" Accessible name for the single-button form.
showLabel boolean false Paint the target mode beside the glyph.
persist boolean true Remember the choice. Private browsing degrades to session-only.

Accessibility

  • One button showing the mode it switches to — a two-button toggle leaves a permanently inactive control that reads as disabled.
  • The change is announced politely, because a theme change is silent and otherwise unverifiable non-visually.
  • The segmented form is a radiogroup: one tab stop, arrow keys to move, and each option is a real choice rather than a toggle.

Design tokens

--lb-surface --lb-outline-strong --lb-primary

Navigation

Start here

Foundations

Components

See it

On this page