Configs & Schema

This article will cover both local and block configs, as well as the block configs schema.

In your local environment, go to your block files, then source configs—there, you'll be able to see our config schema and our default config. 

Config Schema

The config schema is the UI that is presented to the user. It's also where you'll specify the type of content that the user should return with the Element proptypes. Our Prototypes guide will give you an idea of what it looks like in the UI and how to use it.

string: {
label: 'String',
type: ElementPropTypes.string
}

export const defaultConfig = {
string: 'Default string',
}


In our example above, we start with a string that has a label. The label will be what appears in the UI with the exact characters and casing. The type will be the specific Element proptype that you would like to use.

Default Config

The default config is the default value you would like the block to start with. The first time a block is dropped into the page, this is what you will be able to see in that slot. 

If you define text as your prop and specify a custom value that is exclusive to the local environment, the default value will not be visible in your local environment. This tactic is often used when you have a product ID from your store that you’d like to reference a specific value for in your local environment. You don't want to specify that in your block because if that ID gets deleted, the block will appear broken. To avoid this, you can specify your value here, and it will only be present in your local environment.