> For the complete documentation index, see [llms.txt](https://docs.ecwid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ecwid.com/site-themes/develop-site-themes/sections/settings.md).

# Settings

Settings files define the Editor UI for your section — they control what merchants can customize through the Instant Site Editor. Each setting maps to a specific editor widget (text input, image uploader, color picker, toggle, etc.) and specifies its configuration and default values.

### Folder Structure <a href="#folder-structure" id="folder-structure"></a>

```
sections/<section-name>/settings/
├── content.ts       # Content editor definitions (required)
├── design.ts        # Design editor definitions (required)
├── layout.ts        # Layout configurations (optional)
└── translations.ts  # Multi-language text for editor labels and defaults (optional)
```

### Core Concepts <a href="#core-concepts" id="core-concepts"></a>

#### Settings as Records <a href="#settings-as-records" id="settings-as-records"></a>

Both content and design settings are defined as `Record<string, Editor>` objects. The **keys** you choose become the field identifiers used throughout your section — in composables, showcases, and layout configurations.

```typescript
// ContentSettings = Record<string, ContentEditor>
// DesignSettings = Record<string, DesignEditor>
```

#### Factory Functions <a href="#factory-functions" id="factory-functions"></a>

All editors are created using factory functions from `@lightspeed/crane-api`. These factories auto-inject the correct `type` discriminant and provide type safety:

```typescript
import { content, design } from '@lightspeed/crane-api';
```

#### Build-Time Validation <a href="#build-time-validation" id="build-time-validation"></a>

Crane validates all settings files at build time. Invalid configurations (missing required fields, type mismatches, invalid default values) produce clear error messages. Relevant validation errors are documented in each sub-page.

### Minimal Example <a href="#minimal-example" id="minimal-example"></a>

A simple section with a title and background color:

**`settings/content.ts`**

```typescript
import { content } from '@lightspeed/crane-api';

export default {
  title: content.inputbox({
    label: '$label.content.title',
    defaults: { text: '$label.defaults.title' },
  }),
  hero_image: content.image({
    label: '$label.content.hero_image',
  }),
};
```

**`settings/design.ts`**

```typescript
import { design } from '@lightspeed/crane-api';

export default {
  title_style: design.text({
    label: '$label.design.title_style',
    defaults: { font: 'global.fontFamily.heading', size: 32, bold: true, color: '#000000', visible: true },
  }),
  section_background: design.background({
    label: '$label.design.background',
    defaults: { style: 'COLOR', color: '#FFFFFF' },
  }),
};
```

{% hint style="info" icon="sliders" %}
**Key Mapping**

The string keys (`title`, `hero_image`, `title_style`, `section_background`) are the same identifiers you pass to composables like `useInputboxElementContent('title')` and `useTextElementDesign('title_style')`.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ecwid.com/site-themes/develop-site-themes/sections/settings.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
