Set the selected variant (Beta)
Set the selected variant (Beta)
Set the selected variant (Beta)
component.setSelectedVariant(variant)Selects the specified variant of a selected component when the component canvas is open.
To use this method, ensure that the component canvas is open and a variant is currently selected. Then, to specify the variant to select, pass one of these parameters:
component.setSelectedVariant('secondary-hero')id field in an object, as in component.setSelectedVariant({ id: 'secondary-hero' })name field in an object, as in component.setSelectedVariant({ name: 'Secondary Hero' })These methods are in public beta and may change with future releases.
Promise<void>
A promise that resolves when the specified variant is selected.
Checks for authorization only