appearance field that layers on top of the instance-level theme. Use this when a single page mounts multiple elements and a subset needs different chrome (for example, a card at the default size and a bank field at compact).
Example
Cascade order (deepest wins)
- SDK defaults.
- Instance
appearance.sizehost class. - Instance
appearance.variablesinline styles. - Element
appearance.sizehost class (replaces the instance size class on this element only). - Element
appearance.variablesinline styles.
Merge, not replace
Element variables override instance variables only on per-key conflict. Instance keys absent from the element override are preserved.appearance.size also wins per element. Setting size: 'compact' on the element swaps the size-preset class on that element’s host; the instance-level size class is removed from that host first.
Runtime updates
Callelement.update({ appearance: { variables: { ... } } }) to change tokens without remounting:
Composite elements
appearance is not allowed on sub-elements nested inside checkout (or on the fields.fullName slot of billingAddress and shippingAddress). Composite elements are themed as one cohesive visual unit. Setting appearance on a nested slot is a TypeScript error: