Developers
Start building
Themes/Theme SDK/Modules/elements/Types: PlatformSectionType to AcceptedBlock

Types: PlatformSectionType to AcceptedBlock

The types of @poltura/theme-sdk/elements, PlatformSectionType to AcceptedBlock.

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

PlatformSectionType

A section type the platform ships.

type PlatformSectionType = 'account' | 'account-addresses-main' | 'account-order-main' | 'account-orders-main' | 'account-settings-main' | 'announcement-bar' | 'article-main' | 'auth-form' | 'banner' | 'bento' | 'blog-main' | 'cart' | 'checkout' | 'collection-listing' | 'consent-banner' | 'consent-preferences' | 'contact-main' | 'copy' | 'cta-strip' | 'custom-section' | 'faq' | 'faq-main' | 'featured-rail' | 'footer' | 'gallery' | 'gate-main' | 'guide-main' | 'guides-main' | 'header' | 'heading' | 'hero' | 'image-with-text' | 'language-popup' | 'legal-main' | 'logo-list' | 'newsletter-band' | 'newsletter-popup' | 'not-found-main' | 'order-confirmed-main' | 'order-status-main' | 'page-body' | 'page-hero' | 'page-main' | 'partner-badges' | 'password-forgot-main' | 'password-reset-main' | 'payment-band' | 'platform-widget' | 'product-grid' | 'product-information' | 'related-products' | 'rich-text' | 'spacer' | 'stats' | 'steps' | 'store-form' | 'testimonials' | 'trust' | 'trust-row' | 'trust-strip' | 'verify-main' | 'video'

MediaValue

The stored value of a media field: a media:// library file, an asset:// theme file, an image URL, or '' when unset.

type MediaValue = string

IconValue

The stored value of an icon field: a content icon name, lucide:<name>, logo:<id> for a platform logo, or svg:<markup> for a custom icon.

type IconValue = string

SettingsSchema

A settings object: setting id to field.* result, in inspector order.

type SettingsSchema = ElementSettingsSchema

SettingsOf

The settings a component receives for a schema; fields with a default are always present.

type SettingsOf<S extends SettingsSchema> = ElementSettingsOf<S>

FieldSpec

What a field.* builder returns: one setting's inspector description, carrying its value type.

type FieldSpec<TValue = unknown> = FieldDef<TValue>

FieldBuilders

The field builders, one per setting kind: text, number, colour, image, link, product and more.

type FieldBuilders = typeof elementFields

FieldSet

A reusable group of settings: call it with a prefix and spread the result into settings.

type FieldSet<S extends SettingsSchema> = ElementFieldSet<S>

FieldSetOptions

What a field set's call takes beside its prefix: an optional heading, and this use's own defaults and locale paths.

type FieldSetOptions<S extends SettingsSchema = SettingsSchema> = ElementFieldSetOptions<S>

ThemeSettingsDefinition

The theme settings src/settings.ts declares: the panel's groups and their fields.

type ThemeSettingsDefinition = ElementThemeSettingsDefinition

ThemeSettingsGroupDefinition

One group of the theme settings panel: its id, heading and field.* settings by path.

type ThemeSettingsGroupDefinition = ElementThemeSettingsGroupDefinition

ElementCategory

A picker group an element is listed under, such as marketing or product.

type ElementCategory = ElementCategoryName

ElementIntent

What a section is for: its kinds, moods, photos, products, height and source.

type ElementIntent = ElementIntentValue

Example

import type { ElementIntent } from '@poltura/theme-sdk/elements';

const intent: ElementIntent = {
  kinds: ['campaign'],
  photos: { min: 1, max: 1, aspect: 'landscape' },
};

StyleCapability

A group of style controls the inspector's Style tab offers, such as spacing or background.

type StyleCapability = StyleCapabilityName

ElementIconId

An icon of the element picker and navigator.

type ElementIconId = ElementIconName

ElementWording

Own wording of an element, field, preset or slot by admin language, such as { hu: { label: 'Csempék' } }.

type ElementWording = Partial<Record<ElementWordingLanguage, {
    readonly label?: string;
    readonly description?: string;
    readonly placeholder?: string;
    readonly options?: Readonly<Record<string, string>>;
}>>

It wins over machine translation; a language or key left out falls back to it.

ElementSlot

A named region of an element that Slot draws, with its label and accepted children.

namerequiredstring

The name `Slot` draws the region by.

labelrequiredstring

The region's label in the navigator, in the theme's base language.

acceptsstring[]

Child types the region takes, a subset of what the element accepts; omit to take all.

i18nElementWording

The region's own label per admin language.

ElementPreset

A named starting configuration an element offers on insert; a plain insert applies default, other presets get their own tiles.

idrequiredstring

Stable id of the preset within its element.

labelrequiredstring

The preset's label in the picker, in the theme's base language.

descriptionstring

One line shown under the label in the picker.

i18nElementWording

The preset's own label and description per admin language.

settingsElementSettingsSeed

Settings the inserted element starts with.

styleElementStyle

Style of the inserted element itself.

blocksElementSeed[]

Children the inserted element starts with.

ElementScope

A data scope an element reads from above or opens for its children: product or collection.

type ElementScope = ScopeKind

SectionGroup

A page-wide section group outside the templates: header or footer.

type SectionGroup = ElementSectionGroup

BlockFrameTag

The box the platform draws around each block instance: div, li, span, or self for platform elements.

type BlockFrameTag = BlockFrame

ElementStyle

Style values in theme tokens, as an element instance stores them.

type ElementStyle = ElementStyleValue

ElementSeed

A child element a static block or preset starts with.

type ElementSeed = PresetElement

ElementSettingsSeed

Settings an instance starts with, by setting id.

type ElementSettingsSeed = ThemeSettingsBag

ElementAttrs

Attributes to spread on the element's root node, so merchant styling, anchors and the editor reach it.

classNamestring

The class the element's generated style targets; merge it into the root's own classes.

data-pestring

The instance id the customizer selects the element by; present in the editor only.

idstring

The merchant's anchor, so a link to `#<id>` scrolls here; absent when unset.

data-pe-motionstring

`once` or `repeat` when the instance plays an entrance animation; absent otherwise.

data-schemestring

The colour scheme a block draws in, which remaps the colour roles inside it; absent inherits.

ElementRenderProps

What an element component receives for an already computed settings type.

type ElementRenderProps<TSettings>
settingsrequiredTSettings

Translated settings, coerced to the element's schema.

attrsrequiredElementAttrs

Attributes to spread on the root node; empty for an override, whose frame the platform draws.

idrequiredstring

The instance id, unique across the layout file.

ElementProps

What a section or block component receives for its settings schema.

type ElementProps<S extends SettingsSchema = SettingsSchema>
settingsrequiredTSettings

Translated settings, coerced to the element's schema.

attrsrequiredElementAttrs

Attributes to spread on the root node; empty for an override, whose frame the platform draws.

idrequiredstring

The instance id, unique across the layout file.

ElementComponent

A component that draws an element from its settings.

type ElementComponent<TSettings> = (props: ElementRenderProps<TSettings>) => ReactNode

AcceptedBlock

A defineBlock result named in accepts instead of its type key.

kindrequired'block'

Always `block`.

typerequiredstring

The block's type key.

Last updated