alignment
Allows you to display alignment controls for your widget. Depending on the use case, you are able to display horizontal, vertical, or both alignments simultaneously.
Widget Configuration Output
{
"contentAlignment": {
"horizontal": "center",
"vertical": "middle"
}
}
Depending on the alignment control type, certain values are possible:
Content alignment setting | Allowed values |
---|---|
horizontal | "left", "right", "center" |
vertical | "top", "bottom", "middle" |
Widget Configuration Output"
User Interface Output
JSON Schema
typestring
The type of setting component to display.Example: "alignment"labelstring
The user friendly message to inform the user how this setting will be used.Example: "Image alignment"idstring
The variable name where the setting value will be available in the widget template.Example: "imageAlignment"defaultobject
The default value to use when rendering the widget for the first time.typeMetaobject
Additional information needed based on the selected setting type.
boolean
Allows you to display boolean controls for your widget. The control displays as a checkbox.
Widget Configuration Output
{
"displayControls": true
}
User Interface Output
JSON Schema
typestring
The type of setting component to display.Example: "boolean"labelstring
The user friendly message to inform the user how this setting will be used.Example: "Display video controls"idstring
The variable name where the setting value will be available in the widget template.Example: "displayControls"defaultboolean
The default value to use when rendering the widget for the first time.Default: true
box-model
Allows you to display box model controls for your widget.
Widget Configuration Output
{
"productCardMargin": {
"top": {
"value": "0",
"type": "px"
},
"right": {
"value": "10.5",
"type": "px"
},
"bottom": {
"value": "0",
"type": "px"
},
"left": {
"value": "10.5",
"type": "px"
}
}
}
User Interface Output
JSON Schema
typestring
The type of setting component to display.Example: "boxModel"labelstring
The user friendly message to inform the user how this setting will be used.Example: "Margin"idstring
The variable name where the setting value will be available in the widget template.Example: "productCardMargin"defaultobject
The default value to use when rendering the widget for the first time.
code
Allows you to display HTML editor controls for your widget.
Widget Configuration Output
{
"html": "<div>html code can go here</div>"
}
User Interface Output
JSON Schema
idstring
The variable name where the setting value will be available in the widget template.Example: "htmlCode"labelstring
The user friendly message to inform the user how this setting will be used.Example: "HTML Code"defaultstring
The default value to use when rendering the widget for the first time.Example: "<div>html code can go here</div>"typestring
The type of setting component to display.Example: "code"typeMetaobject
Additional information needed based on the selected setting type.
color
Allows you to display color controls for your widget.
Widget Configuration Output
{
"backgroundColor": "#444444"
}
Note
- The resulting color picker supports RGBA.
- You can select transparent as a color. The returned value is the string “transparent”.
User Interface Output
JSON Schema
typestring
The type of setting component to display.Example: "color"labelstring
The user friendly message to inform the user how this setting will be used.Example: "Background color"idstring
The variable name where the setting value will be available in the widget template.Example: "backgroundColor"defaultstring
The default value to use when rendering the widget for the first time.Example: "#444444"
element-settings
Element settings are a way of grouping together settings intended to modify one element of a widget, complete with the option to show or hide the element.
The controls
attribute can contain the following optional objects:
Attribute | Description |
---|---|
visibility | Displays an eyeball icon similar to the Visibility setting type |
advanced | Displays a brush icon that reveals a list of settings when clicked |
Widget Configuration Output
"textBox": {
"visibility": "show",
"backgroundColor": "#FFFFFF"
}
User Interface Output
JSON Schema
typestring
The type of setting component to display.Example: "element"labelstring
The user friendly message to inform the user how this setting will be used.Example: "Box"idstring
The variable name where the setting value will be available in the widget template.Example: "textBox"typeMetaobject
Additional information needed based on the selected setting type.
image-manager
Allows you to display image manager controls for your widget. All uploaded images go to the store’s Image Manager.
Widget Configuration Output
{
"imageUrl": "https://images.unsplash.com/photo-1548768041"
}
Note
The “My Images” button allows the user to select from previously uploaded images.
User Interface Output
JSON Schema
typestring
The type of setting component to display.Example: "imageManager"idstring
The variable name where the setting value will be available in the widget template.Example: "imageUrl"defaultobject
input
Allows you to display input controls for your widget.
Widget Configuration Output
{
"altText": "A cool grey shirt"
}
User Interface Output
JSON Schema
typestring
The type of setting component to display.Example: inputlabelstring
The user friendly message to inform the user how this setting will be used.Example: "Alt text"idstring
The variable name where the setting value will be available in the widget template.Example: "altText"defaultstring
The default value to use when rendering the widget for the first time.Example: "A cool grey shirt"
number
Allows you to display number controls for your widget. The setting supports Both “integer” and “float” parse types.
Widget Configuration Output
{
"fontSize": {
"value": 24,
"type": "px"
}
}
User Interface Output
JSON Schema
typestring
The type of setting component to display.Example: numberlabelstring
The user friendly message to inform the user how this setting will be used.Example: "Font size"idstring
The variable name where the setting value will be available in the widget template.Example: "fontSize"defaultobject
The default value to use when rendering the widget for the first time.typeMetaobject
Additional information needed based on the selected setting type.
product-id
Allows you to display product search controls for your widget.
Widget Configuration Output
{
"productId": "80"
}
User Interface Output
JSON Schema
typestring
The type of setting component to display.Example: "productId"labelstring
The user friendly message to inform the user how this setting will be used.Example: Productidstring
The variable name where the setting value will be available in the widget template.Example: "productId"typeMetaobject
Additional information needed based on the selected setting type.
product-image
Allows you to display product image controls for your widget. The setting looks up product images based on the desired reference
attribute.
Widget Configuration Output
{
"src": "https://cdn11.bigcommerce.com/s-iu88q6epfh/products/121/images/377/850x850__74338.1591376249.386.513.png?c=1",
"type": "PRODUCT_IMAGE"
}
User Interface Output
JSON Schema
typestring
The type of setting component to display.Example: "productImage"labelstring
The user friendly message to inform the user how this setting will be used.Example: "Product Image"idstring
The variable name where the setting value will be available in the widget template.Example: "productImage"typeMetaobject
Additional information needed based on the selected setting type.
range
Allows you to display input controls for your widget.
Widget Configuration Output
{
"lineWidth": 100
}
Note
Units are not currently stored in the widget configuration.
User Interface Output
JSON Schema
typestring
The type of setting component to display.Example: "range"labelstring
The user friendly message to inform the user how this setting will be used.Example: "Line width"idstring
The variable name where the setting value will be available in the widget template.Example: "lineWidth"defaultinteger
The default value to use when rendering the widget for the first time.Example: 100typeMetaobject
Additional information needed based on the selected setting type.
regex-input
Allows you to display regex input controls for your widget. Regex setting can capture and provide conditional state to other schema settings.
Widget Configuration Output
{
"videoUrl": {
"value": "https://www.youtube.com/watch?v=-5EQIiabJvk",
"parts": {
"type":"youtube"
}
}
User Interface Output
JSON Schema
typestring
The type of setting component to display.Example: regexInputlabelstring
The user friendly message to inform the user how this setting will be used.Example: "Video URL (YouTube or Vimeo)"idstring
The variable name where the setting value will be available in the widget template.Example: videoUrldefaultstring
The default value to use when rendering the widget for the first time.Example: ""typeMetaobject
Additional information needed based on the selected setting type.
select
Allows you to display select controls for your widget.
Widget Configuration Output
{
"imageHeight": "auto"
}
User Interface Output
JSON Schema
typestring
The type of setting component to display.Example: selectlabelstring
The user friendly message to inform the user how this setting will be used.Example: "Image height (px)"idstring
The variable name where the setting value will be available in the widget template.Example: "imageHeight"defaultstring
The default value to use when rendering the widget for the first time.Example: autotypeMetaobject
Additional information needed based on the selected setting type.
text
Allows you to display text box controls for your widget.
Widget Configuration Output
{
"bodyText": "This is some text."
}
Note
New line characters are not supported.
User Interface Output
JSON Schema
typestring
The type of setting component to display.Example: textlabelstring
The user friendly message to inform the user how this setting will be used.Example: Body textidstring
The variable name where the setting value will be available in the widget template.Example: bodyTextdefaultstring
The default value to use when rendering the widget for the first time.Example: "This is some text."
typography
Typography allows users to select between either a default widget appearance or a custom appearance.
Widget Configuration Output
{
"textStyle": "default"
}
Note
We recommend exposing custom typography settings via the conditionalSettings
attribute when “custom” is selected.
User Interface Output
JSON Schema
typestring
The type of setting component to display.Example: typographylabelstring
The user friendly message to inform the user how this setting will be used.Example: Text styleidstring
The variable name where the setting value will be available in the widget template.Example: textStyledefaultstring
The default value to use when rendering the widget for the first time.Example: defaulttypeMetaobject
Additional information needed based on the selected setting type.
visibility
Visibility allows the user to toggle between showing or hiding an element.
Widget Configuration Output
{
"buttonVisibility": "show"
}
Output values are “show” or “hide”.
User Interface Output
JSON Schema
typestring
The type of setting component to display.Example: visibilitylabelstring
The user friendly message to inform the user how this setting will be used.Example: Buttonidstring
The variable name where the setting value will be available in the widget template.Example: "buttonVisibility"defaultstring
The default value to use when rendering the widget for the first time. Default values are "show or “hide”.Example: show