Playground

The Playground shell and the swap, bridge and limit widget it hosts.

Composition
Playground composition
The shell around the widget: a left customization rail, the widget stage, an optional variants rail on the right and the Theme Composer FAB. The shared app-shell chrome (side-nav, drawer handle, command palette, FAB) is documented on Components.
Composition
Playground rail
The widget's customization sidebar: a 384 px glass panel pinned to the page edge that drills into sub-screens.

Playground rail .playground-rail

A fixed glass panel that holds the head, screens, sections and footer. Its surface comes from .panel.

The rail's real root-screen markup from playground.html, with position: fixed changed to relative on the rail and handle and the JS hooks removed. The live rail fills its theme cards from localStorage; the mock hardcodes three.

Multi-screen drill data-screen · data-screen-id

Sibling screens inside the shell, one visible at a time, switched by one data attribute.

A drill row sets data-screen on the rail to show the matching sub-panel, and the back arrow restores data-screen="root". Every screen renders in the same fixed-height container, so nothing reflows.

Root screen

Click the highlighted row → data-screen="layout-height".

Composition
Variants rail .ds-doc-variants-rail
A right-docked glass panel of Variant cards for live A/B comparison in design reviews. Clicking a card switches the live widget to that option. It works like the left rail, except it starts collapsed and its drawer handle sits on its left edge. The consumer wires positioning and the variant-switch handler.

Shown at its natural 384 px width. The live rail is position: fixed and slides in from the right; see it in the playground. The drawer handle here is decorative.

Modes & Layout
The widget's modes, presentation, dual layout and the .ui-card shell. Widget primitives use the .ui- prefix; the live build is playground.html.

Widget modes

Bridge, Swap, Limit, Gas and Private share one .ui-card shell and differ in labels, picker route and side panel. Private also requires a receiving wallet.

Each mode is shown without its tab strip, which lives in the form's .screen-header--main.

Bridge

Bridge

Send
0 Select
Receive
0 Select

Any token on any chain to any token on any chain. Both sides are independent.

Swap

Swap

Send
0 Select
Receive
0 Select

Token to token on one chain. Both sides snap to the same chain on every pick.

Limit

Limit

When ETH is worth USDC
2227.17
Market +1% +5% Custom
Sell
0 Select
Buy
0 Select
Expires in 7 days

Market price

on Ethereum
ETH
Ethereum
$2,280.50
2.07%6h 2.47%24h

Trades at a target price on one chain. Adds the limit-price card and expires-in row, labels the slots Sell / Buy, and the side panel shows market price and chart.

Gas

Gas

Send
0 Select
Receive
0 on Arbitrum ETH

Tops up native gas on a destination chain. The only mode whose To side opens a chain picker; the receive token locks to that chain's native gas (ETH on Arbitrum, POL on Polygon, BNB on BSC, …). Only chains with a native-gas avatar are listed.

Private

Private

Send
0.5 ETH
Receive
1,121.57 USDC
Receiving wallet
Private
1,121.57 $1,120.85-0.49%Houdini Swap

Route

Network cost
$2.87
Bridge fee
$2.55
Price impact
-0.49%
Max. slippage
0.30%
Min. received
1,117.87 USDC
1 ETH ≈ 2,242.46 USDC Estimated network fee, paid in the source chain’s native token. $2.87 Estimated time from signature to settlement on the destination chain. 10m

Bridge routed through Houdini Swap, a privacy aggregator. Its single route shows as a compact inline .ui-quote-card after the receiving wallet, with a shield + “Private” chip instead of “Best return”, and the route panel is hidden. Once connected, the .ui-destination-wallet-card is always shown and an address is required. Until it is filled, the card shows an address input (type, paste or “Select”) with a “Required” chip, and Review stays disabled.

Presentation

The widget's modes show in a two-tier View rail (Simple / Advanced) or as one locked type with a title only.

Picked in the playground rail's Presentation drill (body[data-presentation]). View rail is a two-tier left rail that drives the .seg tab bar in the form header; Single shows one widget type with a title. Both call applyMode; only the chrome differs.

View rail

Two tiers on the panel surface (--surface-raised + --elev-3). Simple (shuffle) → Adaptive layout, tabs Bridge · Private · Gas; Advanced (candlesticks) → Dual layout, tabs Swap · Bridge · Limit.

Dual layout

The form plus an always-visible side panel that shows the route list (Swap / Bridge / Gas) or the chart (Limit).

Set from the Layout drill or the View rail's Advanced tier. In Adaptive the panel slides in once a quote is ready; in Dual it is a fixed grid column, so it needs an idle state when there is nothing to show yet.

Route list

Receive

Best return
99.74 $99.71Across
1 USDC ≈ 1.00 USDC $0.18 14s
Fastest
99.61 $99.58Stargate
1 USDC ≈ 1.00 USDC $0.21 9s

The full .ui-quote-list moves to the side panel, as in Adaptive, rather than into the form's quotes drill. The header has a refresh timer while routes are live.

Market-price chart

Market price

on Ethereum
ETH
Ethereum
$2,280.50
2.07%6h 2.47%24h

.ui-token-info + .ui-price-chart show before an amount is typed, since you read the price to set a limit. The header has an expand button instead of a refresh timer.

No amount yet

Receive

Enter an amount to compare routes

Swap, Bridge or Gas with no amount entered shows the .empty-state, never the chart or fake routes. In production it carries [data-routes-idle], is gated on data-quotes-state, and the route list replaces it once there is a quote.

Widget shell .ui-card

The widget's outer container. data-state swaps its content (form, picker, review, tx-progress).

Exchange

Send 25% 50% MAX
100 USDC
Receive
0.0449 ETH
Cards & Fields
The amount pair and amount cards, the destination-wallet card, card labels, quick settings and the settings flow.

Amount pair .ui-amount-pair

Two .ui-amount-cards with a swap-direction button that stays on the seam at any card height.

Matched heights

Send 25% 50% MAX
100 USDC
Receive
0.0449 ETH

Different heights

Send 25% 50% MAX
100 USDC
Receive
0 ETH

Disconnected

Send
0
Receive
0

Both cards use .ui-amount-card--zero (derived values fade), both chips use .avatar-tandem--placeholder with “Select”, and balance and fiat are hidden.

Card label .ui-card-label

The shared style for every widget card title, set by the --ui-card-label-* tokens.

The four real consumers. Change a token once and all of them follow.

Amount card

Send

Limit price card

When ETH is worth

Destination wallet card

Receiving wallet

Received card

Received

Amount card .ui-amount-card

The Send / Receive sub-card: a header, the amount with a token chip, and a footer. It sits one tier above the .panel shell.

Send, hover for quickpicks

Send
USDC

Receive

Receive
0.0449 ETH

Zero state

Send
0 USDC
Receive
0 ETH

Insufficient balance

Send
USDC

Destination wallet card .ui-destination-wallet-card

The chosen send-to wallet on the form: wallet avatar, ENS name or address, and a clear ×. It replaces the footer wallet trigger.

Hidden until .ui-card[data-destination-set], or in Private mode until body[data-widget-mode="private"][data-playground-wallet-connected]. The demos force display:flex.

Empty

Receiving wallet Required

Address typed

Receiving wallet Required

ENS name

Receiving wallet

Pasted address, no ENS

Receiving wallet

Quick settings .ui-quick-settings

Drill rows above the CTA that mirror live settings, so users can review and change them before acting.

Each row is a .setting-row--sm .setting-row--drill whose data-quick-link opens a sub-screen of .ui-settings; its value mirrors the live setting (data-settings-value). Swap and Bridge have separate blocks keyed by data-quick-settings-mode: Swap has three rows, Bridge four, Limit none. The demos force visibility; in production each block is gated on body[data-layout="dual"][data-widget-mode="swap"] or …[data-widget-mode="bridge"].

Compositions per tab

Swap

Bridge

Bridge has its own block (data-quick-settings-mode="bridge") with Route priority instead of Route type and an extra Bridges row, the two settings only a cross-chain route has.

Limit

Limit has no cluster: .ui-orders-panel and .ui-limit-price-card fill the space, and price and expiry don't share these settings. The rows stay in the DOM with display: none.


Icons

Icons on

Icons are off by default. Each row keeps its .setting-row__icon, so the toggle is pure CSS: the 20 px icon column comes back with data-icons="on" on the block or body[data-quick-settings-icons="on"].

Settings flow .ui-settings

An inner state machine: one outer .ui-card state holds a main list and its sub-screens, switched by data-settings-screen.

Both demos use the same .ui-settings at 368 px; only data-settings-screen differs. Changing it swaps the visible [data-settings-content] without re-mounting anything.

Main screen

Settings

Hide small balances

Sub-screen

Appearance

Pickers
The token picker, the split pane beside it and the chain-selection panel.

Token picker .ui-token-picker

The full picker screen inside .ui-card[data-state="picker"]: header, chain shortcuts, search and token lists.

Click a chain tile to filter the list, click the active tile to clear, or click +60 to open the full .card-avatar--more chain picker.

No filter

Send token

Popular

  • ETHEthereum
  • USDCEthereum
  • USDTEthereum
  • DAIEthereum
  • WBTCEthereum
  • ARBArbitrum
  • OPOP Mainnet

All networks is active, so Popular shows tokens from every chain. The body scrolls inside the panel's fixed height.

Arbitrum filter

Send token

Popular

  • ARBArbitrum
  • ETHArbitrum
  • USDCArbitrum
  • USDTArbitrum
  • DAIArbitrum

The Arbitrum tile carries .is-active with the 1 px accent rim, and the list shows Arbitrum tokens only.

Split pane .split-pane

A card that slides in beside a main container. It holds the picker's chain filter and future route detail panels.

Chain selection panel .split-pane--chain-filter

The token picker's network filter in two compositions: a compact mini sidebar (Adaptive) and a balanced regular panel (Dual).

One node, two sizes, switched by layout in picker-render.js → applyChainPanelComposition(). Both filter the same way; only the scale (search, rows, avatars) and the header differ. These demos are static; live rows are rendered by JS.

Mini, Adaptive sidebar

320 px (--w-4) · .search--sm (32 px) · default-tier rows w/ .avatar--sm (32 px) · no header

Regular, Dual receive column

416 px (--w-7, matches the picker) · .search (40 px) · .list-item--lg rows w/ default .avatar (40 px) · 64 px row · directional "From network" / "To network" header (40 px)

Quotes & Orders
Route comparison and limit orders: the limit-price card, quote cards, quote metrics, the inline preview, and the orders panel and row.

Quotes

Limit price card .ui-limit-price-card

The Limit-mode price: a “When BASE is worth” label, invert chip, price input and presets. Past 10 % an off-market alert shows.

Default

When ETH is worth

Zero state

When ETH is worth Limit price

No token picked yet (the playground cold load). As with .ui-amount-card--zero, the price dims to --text-faint at the same weight, the label becomes “Limit price”, and the invert and preset chips hide because there is no market rate. The card stays for context.

Quote card .ui-quote-card

One route in the list. Collapsed it shows the amount and provider; the chevron expands the fee breakdown.

Route comparison

Best return
0.041151 $92.707.27%1inch

Route

Network cost
$7.22
Provider fee
$0.04
Price impact
-7.27%
Max. slippage
0.30%
Min. received
0.041028 ETH
1 USDC ≈ 0.000412 ETH Estimated network fee, paid in the source chain’s native token. $7.22 Estimated time from signature to settlement on the destination chain. 11s
0.041245 $92.917.05%Odos
1 USDC ≈ 0.000412 ETH Estimated network fee, paid in the source chain’s native token. $7.01 Estimated time from signature to settlement on the destination chain. 12s
0.040673 $91.498.51%Bitget
1 USDC ≈ 0.000407 ETH Estimated network fee, paid in the source chain’s native token. $8.29 Estimated time from signature to settlement on the destination chain. 14s

Private mode

Private
1,121.57 $1,120.85-0.49%Houdini Swap

Route

Network cost
$2.87
Bridge fee
$2.55
Price impact
-0.49%
Max. slippage
0.30%
Min. received
1,117.87 USDC
1 ETH ≈ 2,242.46 USDC Estimated network fee, paid in the source chain’s native token. $2.87 Estimated time from signature to settlement on the destination chain. 10m

Private mode shows one Houdini route as a compact inline card after the receiving wallet, and tagDisplay()’s private branch swaps “Best return” for the shield “Private” chip. Shown expanded: unlike the Compact inline teaser, this card keeps its chevron and expands in place.

Mini quote card .ui-quote-mini-card

The Limit-mode route picker: a slim sibling of .ui-quote-card with only the provider icon, name and gas cost.

Three routes, first selected

Quote metric pill .ui-quote-metric

The shared icon + value route metric, with --fee and --eta tones. Used in .ui-quote-card footers and .ui-quote-mini-card rows.

Gas cost

Estimated network fee, paid in the source chain’s native token. $7.22

Execution time

Estimated time from signature to settlement on the destination chain. 11s

Inline quote preview .ui-quote-inline

Shows only the selected .ui-quote-card in the form. In Compact it is a teaser that opens the full list; in Private it is the only quote, so it keeps its chevron and expands in place.

Compact

Best return
553.86 $553.67 1.69% Odos
1 ETH ≈ 2,215.43 USDC $9.04 11s

The live .ui-quote-card.is-active without its chevron. Clicking anywhere opens the full route list.

Private

Private
1,121.57 $1,120.85 -0.49% Houdini Swap

Route

Network cost
$2.87
Bridge fee
$2.55
Price impact
-0.49%
Max. slippage
0.30%
Min. received
1,117.87 USDC
1 ETH ≈ 2,242.46 USDC $2.87 10m

One Houdini route and no drill. The chevron toggles .is-expanded in place (attachInlineToggleDelegate() on the .ui-quote-inline wrapper), and there is no "Show all quotes" button.

Receive panel .ui-receive-panel

The receive-column frame: a Receive header above the route list (.ui-quote-list) in Swap / Bridge / Gas, or the market chart in Limit.

Swap / Bridge / Gas

Receive

Best return
0.041151 $92.707.27%1inch

Route

Network cost
$7.22
Provider fee
$0.04
Price impact
-7.27%
Max. slippage
0.30%
Min. received
0.041028 ETH
1 USDC ≈ 0.000412 ETH Estimated network fee, paid in the source chain’s native token. $7.22 Estimated time from signature to settlement on the destination chain. 11s
0.041245 $92.917.05%Odos
1 USDC ≈ 0.000412 ETH Estimated network fee, paid in the source chain’s native token. $7.01 Estimated time from signature to settlement on the destination chain. 12s

In Swap, Bridge and Gas the body is the .ui-quote-list under a “Receive” screen-header--main with the .refresh-timer. In Limit the same frame holds .ui-token-info + .ui-price-chart; in Dual with no amount, the routes-idle .empty-state.

Orders

Orders panel .ui-orders-panel

Limit mode, under Market Price: a 9-column table of limit orders that scrolls sideways with the chain column pinned.

Nine columns, chain pinned

Orders

Chain Pair Sell Buy Limit Market Filled Expires
EthereumEthereum
ETHUSDC
0.800.80 ETH · $1,244
1,264.00
1,580
1,555
0%
6 days
ArbitrumArbitrum
USDCETH
1,500
0.9804
1,530
1,555
37%
3 days
BaseBase
BTCUSDC
0.05
2,970.00
59,400
59,319
100%
OptimismOptimism
LINKUSDC
800
6,800.00
8.50
7.21
0%
Expired
PolygonPolygon
UNIETH
1,200
2.04
0.00170
0.00154
0%
Cancelled

Wider than the 640 px card, so the body scrolls sideways (drag or shift-scroll to reach the kebab). The chain mark stays pinned while the pair name and values scroll. Expires also shows the lifecycle: a countdown when active, “Expired” in muted grey, “Cancelled” in --danger, and blank when filled, since Filled already reads 100%. The kebab here is static; the live card opens a real .dropdown menu (see Markup).

Orders row

One order row, rendered from fixtures by the shared renderRow the playground uses.

The .ui-orders-panel row: the 9 columns of COLUMN_ORDER at --text-body (16px), with the fill as a plain %. It renders live through window.LifiOrdersList.renderRow(order), so the catalog can’t drift from the product.

Nine columns

Transactions
After the quote: modifying an open order, the shared transaction summary, and the execution status.

Modify order modal .ui-modify-card

Stepped cancel-and-replace flow from the Orders kebab (edit, cancel, place), with the pair locked. Repeat skips the cancel.

Static snapshots of the three modify steps, for a 45 % filled order. The live modal opens from the Orders kebab (“Modify limit” / “Repeat order”) in playground.html, prefilled from the order. Repeat is the same flow in 2 steps, without the cancel.

Step 1 · Edit terms

Step 2 · Cancel order

Step 3 · Place order

Steps 2 and 3 confirm real transactions. The cancel is signed before the place step, so modify mode has no Back past step 2. Repeat shows a 2-disc stepper (Edit terms · Place order) and keeps Back on the place step.

Transaction summary .ui-tx-summary

The shared from→to card, every slot optional. Used by Review, the execution recaps, Activity and Transaction details.

In the Activity list the card is .ui-tx-summary--interactive and opens Transaction details. On Transaction details it is the base variant plus the rate and gas __foot. In both, the chevron expands the Route. Built from .list-item, .avatar tandems and .detail-list.

Route expanded

March 31, 2026 6:49 AM
4
$4.00 · USDC on Base
4
$4.00 · 0% · USDC on Arbitrum
Route Eco
Network cost
<$0.01
Price impact
0%
Exchange rate
1 USDC ≈ 1 USDC
Estimated time
0s
1 USDC ≈ 1 USDC <$0.01

Execution status .ui-tx-status

The widget’s execution screen: hero mark, status text and a step checklist that grows as it runs. data-tx-outcome drives running / success / partial / failed.

data-tx-outcome on the .ui-tx wrapper picks the hero mark (an 80 px .spinner while running, a .spot-icon-4xl --round tone disc after), the lower card (from/↓/to pair or Received) and the footer (See details + Done, or Remove + Retry). Steps are .status-row rows added as execution advances. On the playground, ⌥-click the Review CTA to force the failed path, ⇧-click for partial.

Success

Swap successful
USDC spending approved
Swap transaction confirmed
Sent to wallet: 0x92E5…EE74
Received
0.0447
$99.28 · ETH on Arbitrum

Failed

Transfer failed

Please check the block explorer for more information or try again later.

USDC spending approved
Swap transaction failed
Market Data
Price chart .ui-price-chart
A live candlestick chart: a timeframe selector (1D / 1W / 1M / All) above a canvas with a reference line at the user’s limit price. Rendered by TradingView’s Lightweight Charts (Apache 2.0, ~35 KB). Every painted surface (candles, grid, axes, crosshair, font) resolves to a var(--*) token, so the chart re-tints with the palette and follows the theme. It sits under .ui-token-info, which holds the spot price and deltas; the chart shows the history.

Live: drag to pan, scroll to zoom, hover for the crosshair, click a timeframe to re-range. The dashed accent line is the limit-price annotation, set here at $2,253 because the playground form isn’t on this page. Spot price and deltas are in .ui-token-info.

Market Data
Token info .ui-token-info
A self-contained token snapshot: tandem avatar (token glyph + chain badge), ticker · chain name, spot price, and percent-delta chips for several time windows. Used in the Limit-mode Receive panel and meant for other token contexts (hover cards, popovers, sticky headers, portfolio rows). Each consumer includes only the slots it needs: __identity, __price, __deltas.

Default, all three slots

on Ethereum
ETH
Ethereum
$2,112.40
0.07%5m 0.03%1h 0.45%6h 0.72%24h

Compact, one 24h delta

on Ethereum
USDC
USD Coin
$1.0001
0.01%24h

Identity only

on Ethereum
WBTC
Wrapped Bitcoin
Checkout widget
A pay-in flow partners embed. It takes the user from “I owe X” to a confirmed on-chain deposit, funded one of four ways: Pay from Wallet, Transfer Crypto, Connect Exchange or Deposit with Cash. It is a separate widget type (a single-column, guided multi-screen flow), not an exchange mode, so it doesn’t use the swap widget’s form + routes layout. About 80% is existing primitives; the new parts are the flow panel, the per-method engine and a few screen compositions.

Checkout flow panel .ui-checkout

The guided pay-in flow, inline or in a modal. The funding source picked on the first screen sets the sequence.

A static snapshot of the first screen (Choose funding source). The full flow runs in the Playground (set Widget = Checkout in the rail): token and currency picker, connect wizard, amount entry, deposit address, the Deposit-with-Cash (Transak) path (fiat entry → the fixed-brand Transak sub-modal → pipeline checklist → completion) and the cash error and refund states. LI.FI screens use a centred .screen-header (back · title · close) and a “Powered by LI.FI” footer; the Transak sub-modal keeps its own brand (see Rules).