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.
color-swatchAttribute Selector radiogroup with a CSS-mapped color visual and honest text fallback.
image-swatchAttribute Selector radiogroup with a stable variation-owned image or CSS-mapped image and honest text fallback.

Address country/state controls always use the UIChoice select structure. Their listbox content may be moved into the shared UIChoice host for positioning, so the dropdown content and option row visuals come from the address form select_content_class and select_item_class styling props.

Use the mode that matches the customer interaction: select for compact layouts, radio for visible choices with indicators, button-radio for choice buttons without the radio indicator, and swatches when the option is genuinely easier to recognize visually. Swatches keep radio keyboard behavior and accessible option names. They are currently specific to AttributeSelector; shipping, payment, and address selectors retain their documented mode sets.

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.
preview.quantityProduct Cart QuantityNon-mutating confirmed-quantity sample shown only in the Etch editor.

Class Props

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

Woo class prop values are Etch class style IDs. Values passed to props such as styling.class, styling.item_class, or styling.input_class must resolve to registered Etch styles in etch_styles with class selectors. A matching selector in a global stylesheet is not enough.

For example, a storefront stylesheet can load .store-purchase, .store-choice, .cart-list, .coupon-form, .shipping-choice, .checkout-provider, .address-form__input, or .order-summary-box, but those IDs are unavailable to Woo class props until they are registered as Etch styles. This usually matters for IDs used only through ComponentBlock class props, because they never appear as static builder classes for Etch to discover.

Runtime selectors use data-ome-* attributes. JavaScript, lifecycle behavior, and assertions should target those 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.

Billing and shipping address forms expose select_content_class and select_item_class for the portaled country/state UIChoice listbox. Use those props for dropdown content and option-row styling instead of targeting fixed positioning hooks.

Use this compact map to discover the style IDs a project-owned Woo stylesheet needs to register:

FamilyClass prop paths to check
Product purchaseProductCartQuantity styling.wrapper_class, styling.input_class, styling.decrease_button_class, styling.value_class, styling.increase_button_class; AddToCartForm styling.class; AddToCartButton styling.button_class, styling.wrapper_class, styling.input_class, styling.decrement_button_class, styling.value_class, styling.increment_button_class; AttributeSelector UIChoice props plus styling.swatch_class, styling.swatch_label_class, styling.swatch_fallback_class, and styling.selected_indicator_class; VariationResetButton styling.class; BuyNowButton styling.class.
Cart itemsCartItems styling.root_class, styling.item_class, styling.empty_class; cart item atoms styling.class; CartItemQuantity styling.wrapper_class, styling.label_class, styling.input_class, styling.preview_class, styling.decrease_button_class, styling.value_class, styling.increase_button_class; cart attribute list/name/value class props.
CouponsCouponForm styling.class, styling.input_class; CouponAppliedList styling.root_class, styling.item_class, styling.code_class, styling.empty_class; CouponRemoveButton styling.class.
Cart totalsCartTotalsList and OrderSummaryTotalsList styling.list_class; total atoms styling.class, styling.label_class, styling.value_class.
Checkout shellCheckoutProvider, CheckoutForm, CheckoutNotices, PlaceOrderButton, TermsCheckbox, and PaymentGatewayFieldsSlot styling.class.
Address formsBilling and shipping forms styling.class, styling.items_class, styling.item_class, styling.field_class, styling.label_text_class, styling.legend_class, styling.error_class, styling.input_class, styling.select_content_class, styling.select_item_class; shipping toggle styling.toggle_class.
ShippingShippingMethodSelector UIChoice props: styling.class, styling.item_class, styling.label_class, styling.trigger_class, styling.trigger_label_class, styling.content_class, styling.indicator_class.
PaymentPaymentMethodSelector UIChoice props: styling.class, styling.item_class, styling.label_class, styling.trigger_class, styling.trigger_label_class, styling.content_class, styling.indicator_class.
Order summaryOrderSummary styling.class, styling.items_class, styling.item_class, styling.product_title_class, styling.details_class, styling.quantity_class, styling.price_class, styling.row_class; atom class props when using atom modes.

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.
loading, unresolved, ready, ambiguousProvider-scoped Product Cart Quantity lifecycle.