This file defines section design settings available to users in the Instant Site Editor. If some design settings like text size or font, or element color should be modifiable, you must add these settings to the design.ts file.

Each setting is defined as the element_id object with its properties inside. You can add multiple elements of the same type to the file. If some of the content settings should also have design settings, use the same element_id to link them.

How it looks in the Editor:

editor-design-preview

Find the full list of design types and their configs below:

TEXT

Configuration for text elements.

SettingTypeDescription
typestringAlways TEXT. Works only with INPUTBOX and TEXTAREA element types.
labelstringElement name. Use $label to add translations.
colorsarray of stringsAn array of colors in the HEX code to choose from. Maximum: 7 colors.
enableAlphaColorbooleanDefines if the element can be transparent.
enableAutoColorbooleanDefines if Ecwid should select a matching color for the text automatically.
hideVisibleTogglebooleanDefines if the element visibility toggle is available in the Editor.
sizesarray of numbersAn array of text sizes to choose from. Maximum: 7 sizes.
hideSizebooleanDefines if the element size menu is hidden in the Editor. Set true to hide.
defaultsobjectDefault element settings applied when users install a section.

The defaults object contains the following fields:

SettingTypeDescription
fontstringDefault text font. We recommend leaving global.fontFamily.body here to match the current store font.
sizenumberDefault text size.
boldbooleanDefines if the text is bold by default.
italicbooleanDefines if the text is italicized by default.
colorstringDefault text color in HEX code.
visiblebooleanDefines if the element is visible on the storefront.

Code example for 'design.ts':

element_id: {  
	type: 'TEXT',
	label: '$label.element_id.label', 
	colors: ['#FFFFFF66', '#0000004D', '#00000099', '#64C7FF66', '#F9947266', '#C794CD66', '#FFD17466'],
	sizes: [12, 13, 14, 15, 16, 17, 18, 20],
	defaults: {
		font: 'global.fontFamily.body',
		size: 16,
		bold: false,
		italic: true,
		color: '#333',
}

BUTTON

Configuration for the button element.

SettingTypeDescription
typestringAlways BUTTON. Works only with the BUTTON element type.
labelstringElement name. Use $label to add translations.
colorsarray of stringsAn array of colors in the HEX code for the button background to choose from. Maximum: 7 colors.
enableAlphaColorbooleanDefines if the element can be transparent.
enableAutoColorbooleanDefines if Ecwid should select a matching color for the button automatically.
hideVisibleTogglebooleanDefines if the element visibility toggle is available in the Editor.
hideSizebooleanDefines if the element size menu is hidden in the Editor. Set true to hide.
defaultsobjectDefault element settings applied when users install a section.

The defaults object contains the following fields:

SettingTypeDescription
appearancestringDefault button appearance. Available values: SOLID, OUTLINE, TEXT.
shapestringDefault button shape. Available values: PILL, RECTANGLE, ROUND_CORNER.
sizestringDefault button size. Available values: SMALL, MEDIUM, LARGE.
fontstringDefault text font. We recommend leaving global.fontFamily.body here to match the current store font.
colorstringDefault text color in HEX code.
visiblebooleanDefines if the element is visible on the storefront.

Code example for 'design.ts':

element_id: {  
	type: 'BUTTON',
	label: '$label.element_id.label',
	colors: ['#FFFFFF66', '#0000004D', '#00000099', '#64C7FF66', '#F9947266', '#C794CD66', '#FFD17466'],
	defaults: { 
		font: 'global.fontFamily.body',
		size: 'MEDIUM',
		appearance: 'OUTLINE',
		shape: 'PILL',
		color: '#333',
	},  
}

IMAGE

Configuration for the image uploader element.

SettingTypeDescription
typestringAlways IMAGE. Works only with the IMAGE element type.
labelstringElement name. Use $label to add translations.
colorsarray of stringsAn array of colors in the HEX code for the image background to choose from. Maximum: 7 colors.
enableAlphaColorbooleanDefines if the element can be transparent.
hideVisibleTogglebooleanDefines if the element visibility toggle is available in the Editor.
defaultsobjectDefault element settings applied when users install a section.

The defaults object contains the following fields:

SettingTypeDescription
overlaystringDefault image overlay settings. Available settings: COLOR, GRADIENT, NONE.
colorstring/arrayOne (string type) or two (array with two strings inside) colors for default image overlay settings.

Code example for 'design.ts':

element_id: {  
	type: 'IMAGE',
	label: '$label.element_id.label',
	colors: ['#FFFFFF66', '#0000004D', '#00000099', '#64C7FF66', '#F9947266', '#C794CD66', '#FFD17466'],
	defaults: { 
		overlay: 'COLOR',
		color: '#fff000',
	},  
}

TOGGLE

Configuration for the toggle element.

SettingTypeDescription
typestringAlways TOGGLE. Works only with the TOGGLE element type.
labelstringElement name. Use $label to add translations.
descriptionstringElement description displayed in the Instant Site Editor under the element.
defaultsobjectDefault element settings applied when users install a section.

The defaults object contains the following fields:

SettingTypeDescription
enabledbooleanDefines if the toggle is enabled when users install the section. Set true to enable.

Code example for 'design.ts':

element_id: {  
	type: 'TOGGLE', 
	label: '$label.element_id.label',
	description: '$label.toggle.description', 
	defaults: {
		enabled: true,
	},  
}

SELECTBOX

Configuration for the "selectbox" element that creates a drop-down list in the Editor.

SettingTypeDescription
typestringAlways SELECTBOX. Works only with the SELECTBOX element type.
labelstringElement name. Use $label to add translations.
descriptionstringDescription under the drop-down.
optionsarray of objectsList of options available in the drop-down list.
defaultsobjectDefault element settings applied when users install a section.

The options is an array where each object contains the following fields:

SettingTypeDescription
valuestringOption value.
labelstringText label for the option value.

The defaults object contains the following fields:

SettingTypeDescription
valuestringDefault option value selected when users install a section. If not specified, users see placeholder text instead.

Code example for 'design.ts':

element_id: {  
	type: 'SELECTBOX',
	label: '$label.element_id.label',
	description: '$label.element_id.description',
	options: [
		{  
			value: 'one',
			label: '$label.element_id.one.label',
		},  
		{  
			value: 'two',  
			label: '$label.element_id.two.label',  
		},  
	],  
	defaults: { 
		value: 'two',
	},  
}

BACKGROUND

Configuration for the section background which is not an element type defined in the 'content.ts' file.

SettingTypeDescription
typestringAlways BACKGROUND.
labelstringElement name. Use $label to add translations.
colorsarray of stringsAn array of colors in the HEX code for the background to choose from. Maximum: 7 colors.
enableAlphaColorbooleanDefines if the element can be transparent.
enableAutoColorbooleanDefines if Ecwid should select a matching color for the background automatically.
defaultsobjectDefault element settings applied when users install a section.

The defaults object contains the following fields:

SettingTypeDescription
styleobjectBackground type. Available values: COLOR (single color background) or GRADIENT (background with gradient).
colorstring/arrayOne (string type) or two (array with two strings inside) colors for default background color settings.

Code example for 'design.ts':

element_id: {  
	type: 'BACKGROUND',
	label: '$label.element_id.label',
	colors: ['#FFFFFF66', '#0000004D', '#00000099', '#64C7FF66', '#F9947266', '#C794CD66', '#FFD17466'],
	defaults: {
		style: 'COLOR',
    color: '#fff000',
	}, 
}