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
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
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
Copy Link
One field showing a URL and one control that copies it.
copy-linkdefaultfocuscopiederror
Preview
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value |
string |
— | The URL to copy. Defaults to the current page. |
label |
string |
"Page link" |
Visible field label. |
buttonLabel |
string |
"Copy" |
Control text. |
truncate |
boolean |
true |
Shorten the display; the full value is still what gets copied. |
Accessibility
- The value sits in a read-only input, so it can be selected, tabbed to and copied by hand when the clipboard API is blocked.
- Success is announced through the live region and shown by a glyph swap — two channels, never colour alone.
Design tokens
--lb-surface --lb-outline-strong --lb-r-md
Utilities
Language Switcher
Switch locale, with each language named in its own language.
language-switcherdefaultopenselectedempty
Preview
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
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
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
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
Search
Filter a supplied list of links as you type, with results announced as a count.
searchdefaultfocusresultsempty
Preview
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
items |
array |
[] |
[{ label, href, description?, group? }] |
label |
string |
"Search links" |
Visible field label. |
placeholder |
string |
"Start typing" |
Example value. |
emptyText |
string |
"No matches" |
Shown when nothing matches. |
limit |
number |
8 |
Maximum results shown at once. |
Accessibility
- The result count is announced politely on a debounce, rather than on every keystroke.
- Results are a real list beneath a labelled field — the combobox pattern is deliberately avoided here, because these results are links, not values to pick.
- The empty state carries role="status" so "no matches" is heard, not just seen.
Design tokens
--lb-surface --lb-outline-strong --lb-surface-2
Utilities
Theme Toggle
One control showing the mode it will switch to, with an optional three-way choice.
theme-toggledefaulthoverfocusselected
Preview
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
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