Get props (Beta)
Get props (Beta)
component.getProps()
Returns all prop definitions on a component in props panel display order.
This method returns prop definitions: the schema for each prop including its type, name, group, and default value.
To get the current prop values that are set on a component instance, use element.getProps().
The response includes all prop types, including types that cannot be created via the API at this time (variant, slot, booleanFilter, visibility, filter, sort, selectedItems).
For components with no props, the response is an empty array.
Beta
These methods are in public beta and may change with future releases.
Syntax
Returns
Promise<Prop[]>
A Promise that resolves to an array of Prop objects in props panel display order: ungrouped props first, then groups in order.
The Prop interface uses the same shape as the return value of component.createProp():
valueType and bindableTo for read-only prop types
For information about prop types, see Create a prop.
The following table covers the additional types returned by getProps():
Example
Designer Ability
Checks for authorization only.