Components
Commerce
9 components. Every one is themeable, keyboard operable, and configurable by data attribute, JSON or JavaScript.
Commerce
Affiliate Card
A recommended product with the commercial relationship disclosed on the card, not in a footnote.
affiliate-carddefaulthoverfocus
Preview
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
namerequired |
string |
— | Product name. |
hrefrequired |
string |
— | Affiliate URL. |
vendor |
string |
— | Where it is sold. |
price |
string |
— | Price as text, since affiliate prices move. |
image |
string |
— | Product image URL. |
reason |
string |
— | Why you recommend it, in your own words. |
disclosure |
string |
"Affiliate link — I may earn a commission at no extra cost to you." |
The disclosure text. |
rating |
number |
— | 0–5, in half steps. |
Accessibility
- The disclosure is visible text tied to the link with aria-describedby, so it is announced with the link rather than buried at the page foot.
- rel="sponsored nofollow" is set automatically, which is both an SEO and an honesty requirement.
- A star rating is announced as "4.5 out of 5", not as a row of glyphs.
Design tokens
--lb-surface --lb-outline --lb-on-surface-3
Commerce
Buy Button
A single purchase action with the price on the control.
buy-buttondefaulthoveractivefocusloadingdisabled
Preview
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
label |
string |
"Buy" |
Verb on the button. |
hrefrequired |
string |
— | Checkout URL. |
price |
number |
— | Shown on the right of the control. |
currency |
string |
"USD" |
ISO 4217 code. |
note |
string |
— | A line under the button, e.g. "Secure checkout by Stripe". |
provider |
string |
— | Brand slug for the payment provider, e.g. "stripe". |
brandStyle |
string |
"mark" |
How much of the provider's identity to spend on the control. One of: mark, tint, outline, solid |
loading |
boolean |
false |
Renders the skeleton state, preserving the final layout exactly so nothing shifts on resolve. |
disabled |
boolean |
false |
Uses aria-disabled so the control can still explain itself. |
disabledReason |
string |
— | Why it cannot be used yet. |
Accessibility
- The price is inside the button's accessible name, so "Buy — 32 dollars" is announced as one action.
- Checkout provider names are stated in text, not implied by a logo alone.
Design tokens
--lb-primary --lb-on-primary --lb-control-h-lg
Commerce
Coupon Banner
A discount code that can be copied in one tap, with its expiry stated.
coupon-bannerdefaultcopiedexpired
Preview
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
coderequired |
string |
— | The code itself. |
title |
string |
— | What the code gives, e.g. "20% off everything". |
description |
string |
— | Conditions, in plain words. |
expires |
string |
— | ISO date. The banner hides itself once past. |
href |
string |
— | Adds a Shop action beside the code. |
ctaLabel |
string |
"Shop now" |
Action text. |
Accessibility
- Copy confirms through the live region as well as swapping the glyph — two channels, never colour alone.
- The code is selectable text, so it can still be copied by hand when the clipboard API is unavailable.
- An expired coupon is removed rather than left to disappoint; the expiry date is announced while it is live.
Design tokens
--lb-surface-2 --lb-outline-strong --lb-r-md
Commerce
Digital Download
A paid or free file, with its format, size and licence stated before the click.
digital-downloaddefaulthoverfocus
Preview
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
namerequired |
string |
— | What the download is. |
hrefrequired |
string |
— | Checkout or file URL. |
price |
number |
— | Leave unset or 0 for a free download. |
currency |
string |
"USD" |
ISO 4217 code. |
format |
string |
— | e.g. "WAV + PDF". |
size |
string |
— | e.g. "310 MB". |
licence |
string |
— | e.g. "CC BY 4.0". |
description |
string |
— | One line about the contents. |
image |
string |
— | Cover image URL. |
ctaLabel |
string |
— | Action text. Defaults to Buy or Download by price. |
Accessibility
- Format, size and licence are in the visible text and the accessible name, so nobody buys a file they cannot open or use.
- A free download says "Free" explicitly rather than showing an empty price slot.
Design tokens
--lb-surface --lb-outline --lb-r-lg
Commerce
Donation Widget
Preset amounts plus a free entry, with an optional progress bar toward a goal.
donation-widgetdefaultselectedfocus
Preview
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
title |
string |
"Support the archive" |
Heading. |
description |
string |
— | Why the money matters. |
amounts |
array |
[5,15,40] |
Preset amounts. |
currency |
string |
"USD" |
ISO 4217 code. |
defaultAmount |
number |
— | Which preset starts selected. |
allowCustom |
boolean |
true |
Adds a free-entry amount field. |
hrefrequired |
string |
— | Checkout URL. The amount is appended as ?amount=. |
goal |
number |
— | Target amount. Shows a progress bar with raised. |
raised |
number |
— | Amount raised so far. |
ctaLabel |
string |
"Donate" |
Action text. |
Accessibility
- The presets are a radio group: one tab stop, arrow keys to move, and the selected amount is announced.
- Progress is a real progressbar with aria-valuenow, and the same figures are in text beneath it.
Design tokens
--lb-surface --lb-primary --lb-surface-3
Commerce
Featured Product
The headline item, given a full-width image and room for detail.
featured-productdefaulthoverfocussold-out
Preview
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
namerequired |
string |
— | Product name. |
hrefrequired |
string |
— | Where buying happens. |
price |
number |
— | Current price. |
compareAt |
number |
— | Previous price. |
currency |
string |
"USD" |
ISO 4217 code. |
image |
string |
— | Hero image URL. |
imageAlt |
string |
"" |
Alt text. |
eyebrow |
string |
"Featured" |
Small label above the name. |
description |
string |
— | Two lines about the product. |
bullets |
array |
[] |
Short list of what is included. |
ctaLabel |
string |
"Buy now" |
Action text. |
stock |
number |
— | Units left. |
Accessibility
- The bullets are a real list, so the number of inclusions is announced.
- One featured product per page — the component exists to keep a single clear primary action.
Design tokens
--lb-r-lg --lb-elev-raised --lb-primary
Commerce
Pricing Card
One plan: what it costs, what it includes, and how to start it.
pricing-carddefaulthighlightedhoverfocus
Preview
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
namerequired |
string |
— | Plan name. |
price |
number |
— | Amount per period. |
currency |
string |
"USD" |
ISO 4217 code. |
period |
string |
"month" |
Billing period, e.g. month or year. |
description |
string |
— | Who the plan is for. |
features |
array |
[] |
What is included. |
ctaLabel |
string |
"Choose plan" |
Action text. |
ctaHref |
string |
— | Where the action goes. |
highlighted |
boolean |
false |
Marks the recommended plan. |
highlightLabel |
string |
"Recommended" |
Text of the recommendation marker. |
note |
string |
— | Small print, e.g. "Cancel any time". |
Accessibility
- The recommended plan carries a text marker as well as a heavier border, so the recommendation is not conveyed by weight alone.
- The price and period are one phrase — "12 dollars per month" — rather than two disconnected fragments.
Design tokens
--lb-surface --lb-outline-strong --lb-r-lg --lb-type-h2
Commerce
Product Card
One item: image, name, price and a way to buy it.
product-carddefaulthoverfocusloadingsold-out
Preview
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
namerequired |
string |
— | Product name. |
hrefrequired |
string |
— | Where buying happens. |
price |
number |
— | Current price. |
compareAt |
number |
— | The previous price, struck through when higher. |
currency |
string |
"USD" |
ISO 4217 code. |
image |
string |
— | Product image URL. |
imageAlt |
string |
"" |
Alt text; the product name is already beside it. |
description |
string |
— | One line about the product. |
badge |
string |
— | Short pill, e.g. "New". |
stock |
number |
— | Units left. Under 10 shows a low-stock note; 0 disables the action. |
ctaLabel |
string |
"Buy" |
Action text. |
layout |
string |
"row" |
How the children are arranged. One of: row, stacked |
loading |
boolean |
false |
Renders the skeleton state, preserving the final layout exactly so nothing shifts on resolve. |
Accessibility
- A struck-through price carries a hidden "Was", because strikethrough is not announced by every screen reader.
- Sold out uses aria-disabled and keeps the reason visible, rather than removing the control silently.
Design tokens
--lb-surface --lb-outline --lb-r-lg --lb-warning
Commerce
Tip Jar
A small, low-friction thank-you, framed in the platform's own units.
tip-jardefaultselectedfocus
Preview
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
label |
string |
"Buy me a coffee" |
What the tip is called. |
hrefrequired |
string |
— | Tipping page URL. |
unitPrice |
number |
5 |
Price of one unit. |
currency |
string |
"USD" |
ISO 4217 code. |
counts |
array |
[1,3,5] |
Selectable quantities. |
supporters |
number |
— | How many people have tipped. |
provider |
string |
— | Brand slug, e.g. "kofi" or "buymeacoffee". |
brandStyle |
string |
"mark" |
How much of the provider's identity to spend on the control. One of: mark, tint, outline, solid |
Accessibility
- Quantities are a radio group, so the whole row is one tab stop and arrow keys select.
- The action's name includes the quantity and the total, so it is unambiguous when read out of context.
Design tokens
--lb-surface --lb-outline-strong --lb-primary