change-option
Section titled “change-option”- Purpose: renders one product option, emits the selection, and provides
optionContextto its descendant option displayers. Auto-detects mode from its children: select (<select>with a template<option>), radio (input[type=radio]wrappers), or swatch/button (option-valuepills). Clones the per-value template, marks the active value, and marks unavailable/nonexistent values. - Attributes:
name : string = ""- option name, matched case-insensitively (e.g.name="color"resolvesColor); the element canonicalizes itself to the option’s real name.group : number = 0- 1-based option index (group="1"= first option). Used whennameis absent.group="0"/negative resolves nothing (SSK-207).- (Author exactly one of
name/group; neither → renders nothing, SSK-204.) namevsgroup:nameis for a single known product; a non-matchingnamemakes the element self-hide (display: none) - silent, no error. On any multi-product surface (a dynamic[handle]route, a shared PDP layout) usegroup=: three blocks (group="1"/"2"/"3") cover every Shopify product, extras self-hide (SSK-208/209; blueprint in build-patterns §2.2 “Option pickers on multi-product routes”).
- Required ancestor / context:
storesynk-product(consumesproductContext); providesoptionContext({ name, group, selected }). - Children / template rule: TEMPLATE-CLONE - first
<option>(select mode), first radio wrapper (radio mode), or firstoption-value(swatch mode) is the per-value template. - Events: emits
sf:option-change(bubbles, composed;detail = { name, value }). - State it sets: on each
option-valueit setsvalue, toggles the[ss-active]attribute, and sets[ss-unavailable]="nonexistent"/[ss-unavailable]="out-of-stock". Hides itself when the option isn’t found.
option-value
Section titled “option-value”- Purpose: styleable container for one option value (pill / swatch / radio wrapper). The
first one is the clone template. A logic-free styleable element - no logic of its own.
(Renamed from
value-option.) - Attributes:
value : string- ENGINE-SET (the option value name). Do not author.
- Required ancestor / context:
change-option(SSK-108). - Children: optionally
show-option-titleand/orshow-option-swatch, a radio<input>, etc. - Events / state: none of its own; receives
value,[ss-active],[ss-unavailable]fromchange-option.
show-option-title
Section titled “show-option-title”- Purpose: invisible (
display:contents) text holder inside anoption-value; the engine writes that value’s name (e.g. “Red”) into it. A logic-free invisible element. (Renamed fromshow-label.) - Attributes: none.
- Required ancestor / context:
option-valuewithinchange-option(SSK-108). - Events / state: none.
show-option-swatch
Section titled “show-option-swatch”- Purpose: swatch visual inside an
option-value; the engine fills its background color or image from the option value’s swatch data. A logic-free styleable element. (Renamed fromshow-swatch.) - Attributes:
type : "color" | "image" = ""- how to render the swatch. Withcolor, the engine setsbackground-color; withimage, it sets an<img>src(if present) or abackground-image. (Iftypeis absent the engine still falls back to color, then image.)
- Required ancestor / context:
option-valuewithinchange-option(SSK-108). - Children: optionally an
<img>(for image swatches). - Events / state: none of its own (engine sets inline
style).
show-option-label
Section titled “show-option-label”- Purpose: displays an option group’s name (e.g. “Color”). Dual-mode: nested inside
a
change-optionit reads the group fromoptionContext; standalone it resolves from agroup/nameattribute + the product. (New.) - Attributes:
group : number = 0- 1-based option index (standalone mode).name : string = ""- option name, case-insensitive (standalone mode).- (Inside a
change-option, neither is needed - it reads the context.)
- Required ancestor / context:
storesynk-product(consumesproductContext), optionally insidechange-option(consumesoptionContext). - Events / state: none.
show-active-option-title
Section titled “show-active-option-title”- Purpose: displays the currently selected value for a group (e.g. “Red”). Same
dual-mode resolution as
show-option-label. (New.) - Attributes:
group : number = 0- 1-based option index (standalone mode).name : string = ""- option name, case-insensitive (standalone mode).
- Required ancestor / context:
storesynk-product, optionally insidechange-option. - Events / state: none. Re-renders as the selection changes.
Imported from the Storesynk skill v0.1.0 (references/component-reference.md). To change this page, change it there.