SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

Commerce foundations

What @sdxc/ui/commerce is for, the forms-first rules its parts share, and every variable it reads.

The pieces of ordering something to be delivered: a menu item and the dialog that asks for its options, priced option groups, cart lines with a quantity stepper, and an order's live status.

Every piece is a form or a link first, so a cart fills and an order places with script off; the islands only reprice and track live.

typescript
import "@sdxc/ui/theme.css";
import { … } from "@sdxc/ui/commerce";

When to reach for it

  • A food delivery, grocery or takeaway menu whose items ask for picks with prices.
  • A cart whose counts change with one tap, and still post without script.
  • An order, delivery or job whose progress streams from the server while the visitor watches.

Shared ideas

  • Forms firstSteppers, picks and Place order are plain posts; the server prices and checks them.
  • Prices in minor unitsEvery choice carries data-price in cents; OptionsLive sums them with the form's data-base.
  • Native dialogsA menu card opens its <dialog> with commandfor; it is a bottom sheet on a phone.
  • Limits on the formA required group is radios; extras are checkboxes that stop at max once script loads.
  • Progress as textOrderLive reads <step> <progress> <minutes> lines from any text/plain stream.
  • Maps by attributeThe tracker moves any [data-map-marker] on the page, so it pairs with a map without importing one.

CSS variables

Every custom property the namespace reads or declares, with its default and what it controls.

Reads the neutral role for text, hairlines and surfaces, and brand for the add button, ticked picks and the steps already done. The roles are documented on Theming.

Shared

The commerce pieces read the theme's own tokens; none is declared for them alone.

VariableDefaultWhat it controls
--ui-radius-lg1remThe corner of a menu item card.
--ui-color-brand-600the brand scaleTicked picks, the done steps' dots and rail, and the current step's ring.
--ui-map-progressset by OrderLiveWritten on each [data-map-marker] as the order moves, from 0 to 1.
@sdxc/ui

Can’t find it? Contact us