Set variant settings (Beta)
Set variant settings (Beta)
component.setVariant(variantId, settings)
component.setVariant(settings)
Updates the settings of a variant.
Currently only changing the name of a variant is supported.
Beta
These methods are in public beta and may change with future releases.
Syntax
To update a variant by passing its ID and settings as separate arguments:
To update a variant by passing a single options object:
Related interface:
Parameters
Two-argument form:
variantId: string — The ID of the variant to update. Pass'base'to update the base variant.settings: object — An object specifying the settings to update:name: string — The new name for the variant.
Options object form:
options: SetVariantOptions — An object specifying the variant to update and its new settings:id: string — The ID of the variant to update. Pass'base'to update the base variant.name: string — The new name for the variant.
Returns
Promise<Variant>
A Promise that resolves to the updated Variant object.
Examples
Update a variant using the two-argument form:
Update a variant using the options object form:
Rename the base variant:
Name conflicts auto-increment: