Developers
Start building
Themes/Theme SDK/Modules/elements/Types: StaticBlockDefinition to EditableTextProps

Types: StaticBlockDefinition to EditableTextProps

The types of @poltura/theme-sdk/elements, StaticBlockDefinition to EditableTextProps.

On this page
import { … } from '@poltura/theme-sdk/elements';

StaticBlockDefinition

One fixed child of a section or block that merchants can hide and restyle but never move or delete.

idrequiredstring

Developer id, unique in this definition: lowercase letters, digits, `-` and `_`.

typerequiredstring | AcceptedBlock

The child's type key, or the `defineBlock` result.

slotstring

Region it renders in; omit to place it only where the component draws it.

requiredboolean

Whether merchants cannot hide it either.

settingsElementSettingsSeed

Settings it starts with.

styleElementStyle

Style it starts with, in theme tokens.

blocksreadonly ElementSeed[]

Children it starts with.

ElementBlocksRule

Which child elements an element accepts, in the customizer and in saved layouts.

acceptsrequiredreadonly (string | AcceptedBlock)[]

Accepted children: `defineBlock` results, type keys, or the wildcards `ELEMENT_WILDCARD` and `THEME_BLOCK_WILDCARD`.

maxnumber

Upper bound on direct children; static children do not count.

staticreadonly StaticBlockDefinition[]

Fixed children with developer ids.

ElementContextRule

Scopes an element reads from above (requires) and opens for its children (provides).

requiresreadonly ElementScope[]

Scopes that must be open above the element; the editor refuses it anywhere else.

providesreadonly ElementScope[]

Scopes the element opens for its children.

ElementDefinitionBase

What sections and blocks share in their definition; every property is literal data the compiler reads statically.

type ElementDefinitionBase<S extends SettingsSchema>
typerequiredstring

Stable type key saved in every layout file; reusing a platform key replaces that element everywhere.

labelrequiredstring

Picker and navigator label, in the theme's base language.

descriptionstring

One line shown under the label in the picker and in the inspector's "What is this?".

i18nElementWording

The element's own label and description per admin language; it wins over machine translation.

iconElementIconId

Picker and navigator icon.

categoryElementCategory

Picker group; theme elements without one appear under "This theme".

settingsS

Inspector settings built with `field.*`; key order is the inspector order.

blocksElementBlocksRule

Child elements this element accepts; omit for a leaf element.

slotsreadonly ElementSlot[]

Named regions the component draws with `Slot`.

stylereadonly StyleCapability[]

Style groups the inspector's Style tab offers.

presetsreadonly ElementPreset[]

Named starting configurations offered on insert; `default` is what a plain insert applies.

contextElementContextRule

Scopes the element reads and opens.

keywordsreadonly string[]

Extra picker search terms, such as synonyms in other languages.

renamedFromstring | readonly string[]

Type keys this element used to have, so saved layouts are rewritten on the next build.

templatesreadonly string[]

Page templates the element may be added to; omit to allow every template.

SectionDefinition

The object passed to defineSection.

type SectionDefinition<S extends SettingsSchema>
typerequiredstring

Stable type key saved in every layout file; reusing a platform key replaces that element everywhere.

labelrequiredstring

Picker and navigator label, in the theme's base language.

descriptionstring

One line shown under the label in the picker and in the inspector's "What is this?".

i18nElementWording

The element's own label and description per admin language; it wins over machine translation.

iconElementIconId

Picker and navigator icon.

categoryElementCategory

Picker group; theme elements without one appear under "This theme".

settingsS

Inspector settings built with `field.*`; key order is the inspector order.

blocksElementBlocksRule

Child elements this element accepts; omit for a leaf element.

slotsreadonly ElementSlot[]

Named regions the component draws with `Slot`.

stylereadonly StyleCapability[]

Style groups the inspector's Style tab offers.

presetsreadonly ElementPreset[]

Named starting configurations offered on insert; `default` is what a plain insert applies.

contextElementContextRule

Scopes the element reads and opens.

keywordsreadonly string[]

Extra picker search terms, such as synonyms in other languages.

renamedFromstring | readonly string[]

Type keys this element used to have, so saved layouts are rewritten on the next build.

templatesreadonly string[]

Page templates the element may be added to; omit to allow every template.

intentElementIntent

What the section is for, so a search can offer it by kind, mood and photos; omit for none.

groupsreadonly SectionGroup[]

Section groups outside the templates the section may also be added to.

limitnumber

Most instances of the section in one template or section group.

componentrequiredElementComponent<SettingsOf<NoInfer<S>>>

Draws the section.

BlockDefinition

The object passed to defineBlock.

type BlockDefinition<S extends SettingsSchema>
typerequiredstring

Stable type key saved in every layout file; reusing a platform key replaces that element everywhere.

labelrequiredstring

Picker and navigator label, in the theme's base language.

descriptionstring

One line shown under the label in the picker and in the inspector's "What is this?".

i18nElementWording

The element's own label and description per admin language; it wins over machine translation.

iconElementIconId

Picker and navigator icon.

categoryElementCategory

Picker group; theme elements without one appear under "This theme".

settingsS

Inspector settings built with `field.*`; key order is the inspector order.

blocksElementBlocksRule

Child elements this element accepts; omit for a leaf element.

slotsreadonly ElementSlot[]

Named regions the component draws with `Slot`.

stylereadonly StyleCapability[]

Style groups the inspector's Style tab offers.

presetsreadonly ElementPreset[]

Named starting configurations offered on insert; `default` is what a plain insert applies.

contextElementContextRule

Scopes the element reads and opens.

keywordsreadonly string[]

Extra picker search terms, such as synonyms in other languages.

renamedFromstring | readonly string[]

Type keys this element used to have, so saved layouts are rewritten on the next build.

templatesreadonly string[]

Page templates the element may be added to; omit to allow every template.

frameBlockFrameTag

The box drawn around each instance; `div` when omitted, `li` inside a list region, `span` for inline content.

componentrequiredElementComponent<SettingsOf<NoInfer<S>>>

Draws the block.

SectionElement

A declared section, ready to export from a file under src/sections.

kindrequired'section'

Always `section`.

typerequiredstring

The section's type key.

BlockElement

A declared block, ready to export from a file under src/blocks or src/sections.

kindrequired'block'

Always `block`.

typerequiredstring

The block's type key.

SectionOverride

A theme renderer for a platform section type whose schema, inspector and data the platform keeps.

type SectionOverride<T extends PlatformSectionType>
kindrequired'section'

Always `section`.

typerequiredT

The platform section type it draws.

overriderequiredtrue

Always true: the schema stays the platform's.

BlockOverride

A theme renderer for a platform block type whose schema, inspector and data the platform keeps.

type BlockOverride<T extends PlatformBlockType>
kindrequired'block'

Always `block`.

typerequiredT

The platform block type it draws.

overriderequiredtrue

Always true: the schema stays the platform's.

SlotTag

The element type of a slot's box; none draws the children straight into the parent.

type SlotTag = 'div' | 'ul' | 'ol' | 'nav' | 'none'

SlotProps

Props of Slot.

namestring

A region the definition declares in `slots`; omit for the default region.

classNamestring

Classes for the region's box, which is the children's layout box.

asSlotTag

Element type of the region's box; `div` when omitted.

EditableTextTag

A tag EditableText can render.

type EditableTextTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div' | 'strong' | 'em' | 'small' | 'label' | 'li' | 'figcaption' | 'blockquote'

EditableTextProps

Props of EditableText.

settingrequiredstring

Id of a `text` or `textarea` setting of the current element.

asEditableTextTag

Tag to render; `span` when omitted.

classNamestring

Classes added to the tag.

Last updated