Skip to content

SubmitBar ​

A bottom action bar for pages or sections: extra area (default slot for agreements, notes, etc.) + total amount + primary action button. The total is rendered by the nested oas-price, and the button covers loading, disabled and danger states.

Basic usage ​

total is the amount and action-text the button label; clicking dispatches oas-submit with { total, currency }.

Total + primary action + event feedback

Click the action button to see oas-submit feedback.

Extra content ​

The default slot renders before the total — useful for agreement checkboxes or discount notes; it collapses when empty so the amount is never squeezed.

Agreement checkbox

Loading / disabled / danger ​

loading disables the button, shows a spinner and sets aria-busy="true"; disabled keeps the visuals but blocks the event; danger switches the primary button to the danger color.

States

Tip line ​

tip renders a notice line above the main row (shipping fee / invoice notes and similar), and tip-icon takes a registered icon name (unregistered names warn once in dev and skip the icon; the text stays readable):

Shipping-fee tip

Safe area and placeholder ​

The bar's block-end padding uses max(spacing, env(safe-area-inset-bottom)) (notches and gesture bars are avoided automatically). The bar is position: sticky by default (it already occupies the flow, so no spacer is needed). When the host overrides it to fixed with CSS, the spacer is the host's responsibility — add padding-bottom to the page tail and align it with --oas-submit-bar-height (the bar's min-height token, default --oas-control-height-xl). Note the token is a minimum: in the default theme the bar without a tip renders at ≈57px (vertical padding 16 + main row 40 + top border 1), so a 57px fallback in the recipe is closer to reality; with a tip line, stack its rendered height on top (a single-line tip measures ≈27.5px; wrapped copy is taller — go by the actual render):

Fixed-layout spacer recipe (host padding-bottom)

/* Host-side style example */
.checkout-page oas-submit-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
}
.checkout-page {
  /* Tail spacer aligned with the bar's rendered height: the min-height token
     (default 48px) is only the floor — the bar actually renders ≈57px
     (vertical padding 16 + main row 40 + top border 1);
     with a tip line, stack its rendered height (single line ≈27.5px) */
  padding-bottom: var(--oas-submit-bar-height, 57px);
}

Currency and precision ​

The total is formatted by the same code path as oas-price: currency switches the currency, locale decides symbol placement and grouping and precision sets the decimal places.

Multi-currency / no decimals

Toggling state ​

Hosts can toggle loading by writing the attribute; no oas-submit fires while loading.

Toggle loading

Toggle loading

Styling notes ​

::part(bar) is a two-layer column flex — the ::part(tip) line stacks above the ::part(row) main row. Overriding flex-direction on ::part(bar) squeezes the tip and the main row onto one line; if you need a different layout, take ::part(tip) / ::part(row) into account together. For fixed-layout spacing see the "Safe area and placeholder" recipe above (align with --oas-submit-bar-height).

API ​

oas-submit-bar ​

Attributes ​

AttributeDescriptionTypeDefault
action-textPrimary button text; when omitted no button renders (amount + extra area only)——
currencyISO 4217 currency, default CNYstringCNY
dangerPrimary button uses the danger color (destructive main actions)boolean—
disabledDisables the button (honours config-provider injected disabled)boolean—
labelTotal label, defaults to the i18n submitBar.total——
loadingLoading: button disabled + spinner + aria-busy, no events dispatchedboolean—
localeAmount formatting locale; defaults to the document <html lang>, then en——
precisionAmount decimal places, default 2string2
tipTip line text (shipping fee / invoice notices shown above the main row)——
tip-iconTip icon name (resolved through the icon registry, custom registration wins); unregistered names warn once in dev and skip the icon, the text stays readable——
totalTotal amount (numeric string); omitted renders no amount——

Events ​

EventDescription
oas-submitDispatched on primary button click (not loading / disabled) with { total, currency }, detail: { total: this.totalValue(), currency: this.getAttr('currency', 'CNY').trim().toUpperCase() || 'CNY', } satisfies SubmitBarDetail

Slots ​

NameDescription
defaultExtra content before the total (agreement checkboxes, notes, etc.)
totalOverrides the default amount rendering

CSS Variables ​

CSS VariableDefault
--oas-submit-bar-heightvar(--oas-control-height-xl, 48px)

Released under the MIT OR Apache-2.0 License.