Sections
Sections are the building blocks of pages — self-contained UI components that define their own content, design, and rendering logic. Merchants interact with sections through the Instant Site Editor, where they can customize content (text, images, buttons) and design (colors, fonts, backgrounds) based on settings you define.
Section Types
Every section has a type that determines where it can be used:
SECTION
Standard page section — used within template pages
HEADER
Site header — appears at the top of every page. Has Mandatory Settings
FOOTER
Site footer — appears at the bottom of every page
Folder Structure
Each section lives in its own directory under sections/:
sections/<section-name>/
├── client.ts # Client-side hydration entry point
├── server.ts # Server-side rendering entry point
├── Section.vue # Vue component
├── type.ts # TypeScript type definitions (Content, Design)
├── settings/
│ ├── content.ts # Content editor definitions
│ ├── design.ts # Design editor definitions
│ ├── layout.ts # Layout configurations (optional)
│ └── translations.ts # Translation strings (optional)
└── showcases/ # Showcase configurations (optional)
├── 1.ts
├── 2.ts
└── translations.ts # Showcase-specific translations (optional)Files Overview
Entry Points
server.ts— Server-side rendering entry point. UsescreateVueServerAppto render the section to HTML on the server. See Serverclient.ts— Client-side hydration entry point. UsescreateVueClientAppto hydrate the server-rendered HTML in the browser. See Client
Component and Types
Section.vue— The Vue 3 component that renders the section UI. Uses Composables to access content and design data.type.ts— TypeScript type definitions usingInferContentTypeandInferDesignTypeto derive types from your settings files.
Settings
Settings files define what merchants can customize in the Editor. They determine which editors appear (text inputs, image uploaders, color pickers, etc.) and their default values.
content.ts— Defines content editors (text, images, buttons, etc.)design.ts— Defines design editors (colors, fonts, backgrounds, etc.)layout.ts— Defines layout variations for the section (optional)translations.ts— Multi-language text for editor labels and defaults (optional)
See Settings for full documentation.
Showcases
Showcases define pre-configured variations of a section with specific default content and design values. They appear as selectable presets when merchants add the section to a page.
See Showcases for details.
Mandatory Settings
Sections with type HEADER have mandatory settings that must be present:
Content: menu (type NAVIGATION_MENU) and logo (type LOGO)
Design: logo (type LOGO)
These are enforced at build time. Standard SECTION and FOOTER types have no mandatory settings.
Linting
Crane provides @lightspeed/eslint-config-crane — a preconfigured ESLint setup for section development. The template scaffolds an eslint.config.cjs that consumes it as a one-liner:
What It Includes
Vue 3 —
eslint-plugin-vuewith recommended rulesTypeScript —
@vue/eslint-config-typescriptrecommended rulesScoped CSS —
eslint-plugin-vue-scoped-cssrecommended rulesAccessibility —
eslint-plugin-vuejs-accessibility
Notable Rules
vue/component-api-style
script-setup, composition
Only Composition API with <script setup> allowed
max-len
160
Maximum line length for .ts and .vue files
no-console
warn
Console statements produce warnings
no-debugger
warn
Debugger statements produce warnings
Running the Linter
The template does not include a lint script by default. Run ESLint directly:
Or add a script to your package.json:
Advanced Composables
These composables are exported from @lightspeed/crane-api for advanced use cases. Most sections won't need them.
useVueBaseProps
Low-level composable providing reactive access to the full section context:
context— store and environment informationcontent— raw content datadesign— raw design datadefaults— default valuessite— site configuration (languages, currency, etc.)category— current category data (on category pages)storeData— store metadataglobalDesign— global design settings (colors, fonts, text sizes)tileId— the section's tile identifier
Use this when the typed content/design composables are not sufficient — for example, when accessing global design tokens directly or reading site-level configuration.
useInstantsiteJsApi
Returns window.instantsite — the platform's JavaScript API for interacting with the storefront runtime (e.g., triggering cart updates, navigation events).
Learn more
Client — Client-side hydration
Server — Server-side rendering
Settings — Define content and design editors
Showcases — Pre-configured section variations
Composables — Access content and design data in Vue components
Last updated
Was this helpful?
