The Style Manager is organized into sectors. Each sector contains a list of properties.
Sector Configuration
name: The display name of the sector.id: (Optional) A unique identifier to access the sector via API. If not provided, it is generated from the name.open: (Optional) Boolean indicating if the sector should be open by default.properties: An array of property definitions.
Property Configuration
Each property defines a CSS property to change. Common options include:
type: The UI type (e.g., number, color, select).label: The display label for the property.property: The actual CSS property name (e.g., padding, font-size).default: The default value.id: (Optional) The property ID. If missing, it defaults to the property value.
Example of a numeric padding property:
{
type: 'number',
label: 'Padding',
property: 'padding',
default: '0',
units: ['px', '%'],
min: 0,
}
grapesjs.init({
styleManager: {
sectors: [
{
name: 'First sector',
properties: [],
// id: 'first-sector',
// open: true,
},
{
name: 'Second sector',
open: false,
properties: [],
},
],
},
});