Skip to main content

Shared Controls and Props

Several Woo families share the same authoring ideas. These props are shared because the runtime shares behavior, not because they are cosmetic conveniences.

UIChoice Selectors

AttributeSelector, ShippingMethodSelector, address country/state fields, and PaymentMethodSelector all use the shared UIChoice runtime.

PropApplies toMeaning
ui.modeAttribute, shipping, paymentSelects the control structure. Supported modes depend on the component.
ui.aria_labelAttribute, shipping, paymentAccessible name on the selector root.
ui.default_labelSelect mode selectorsTrigger text before a selected option is resolved.
ui.html_tagUIChoice components that expose itRoot element tag for authored structure.

Mode behavior:

ModeMarkup and runtime
selectRenders a trigger and hidden listbox content. Runtime may move content into the shared UIChoice host for positioning.
radioRenders an in-tree radiogroup with UIChoice indicators.
button-radioRenders an in-tree radiogroup without the radio indicator.

E2E covers button-radio and select modes for shipping and payment selectors, and select/button-radio modes for variation selection.

Content Props

Content props control visible labels and fallback text:

Prop groupComponentsNotes
content.labelAdd-to-cart button, buy-now button, remove buttons, place-order buttonButton text; ARIA labels can mirror it.
content.successMsgAdd-to-cart buttonTemporary button text after successful add.
content.show_price and content.price_separatorShipping selectorControls shipping rate label composition.
content.show_descriptionPayment selectorRemoves payment method descriptions when false.
content.show_empty_message and content.empty_messageCoupon applied listControls the empty coupon message.
content.include_attributes and content.variant_separatorCart item title, order summaryControls composed variant title text.

Structure Props

Structure props are for authored HTML semantics, not runtime targeting.

PropApplies toMeaning
structure.root_tagCartItems, CartAttributeList, totals listsRoot wrapper element.
structure.item_tagCartItems, CartAttributeListRow element for item or attribute loops.
structure.empty_tagCartItemsEmpty-state wrapper element.
structure.html_tagLabeled total atomsWrapper element when a total atom shows a label.

Preview Props

Preview props affect deterministic Etch builder output. They do not change live Woo cart or checkout data.

PropApplies toMeaning
preview.rowsCartItems, CartAttributeList, CouponAppliedListNumber of rows shown in builder preview.
preview.empty_stateCartItems, CouponAppliedListShows the authored empty state in builder preview.
preview.show_in_builderCart and checkout noticesShows a sample notice in builder preview.
preview.notice_typeCart and checkout noticesSets the builder notice type sample.
preview.stateAddress form fieldsShows idle or error state in builder preview.
shipping_toggle.preview_checkedShipping address formInitial builder state for the different-shipping toggle.

Class Props

Woo components rely heavily on class props so authors can style each atomic part without changing runtime selectors.

Runtime selectors use data-ome-* attributes. Class props should be treated as styling hooks only.

Important shared style groups:

GroupComponents
UIChoice stylesAttribute selector, shipping selector, payment selector, address country/state controls.
Control default stylesCoupon input and checkout fields.
Cart totals stylesTotalsSubtotal, TotalsDiscount, TotalsShipping, TotalsTax, TotalsTotal.
Address form field stylesBilling and shipping address forms.

State Attributes

Woo runtime state is reflected through data-ome-state.

StateCommon surfaces
idleReady forms, buttons, notice regions without active feedback.
loading, updating, processingCheckout store states.
successSuccessful add-to-cart, coupon, quantity, remove, and checkout submit actions.
errorLocal validation, Store API errors, notice regions.
has-items, emptyCart count, cart items, coupon list, quantity preview.
ready, hidden, textAddress fields and shipping selector availability.
unavailable, invalidProduct purchase forms.