Composite
Configurator
A product configurator assembled from ModelViewer, Tabs and selection blocks.
Configurator puts a ModelViewer and a live summary in the left column and a tabbed choice panel in the right one. Each category becomes one tab and one selection group: a toggle category renders a ToggleGroup, a grid category an ItemsGrid in selection mode, and a text category a TextArea. Options carry the scene mutations they apply, so the viewer’s selections map is built for you. See the jewellery store demo for the full experience.
Category types
ConfiguratorToggleCategory (panel: 'toggle') takes ToggleGroup options. ConfiguratorGridCategory (panel: 'grid') takes ItemsGrid items as options, each with a required code, and a mode of 'single' or 'multiple'; min and max exist only for 'multiple'. ConfiguratorTextCategory (panel: 'text') takes value and an optional fieldLabel; without it the heading names the field and no label is shown. maxLength, placeholder and every other TextArea prop or native <textarea> attribute go in textArea. Every category has a name (its selection group), a heading that names the panel, an optional triggerButton Button config for its tab (its label defaults to the heading), and an optional camera key of modelViewer.cameraPresets. A category’s panel config goes in toggleGroup, itemsGrid or textArea, matching its panel. The rule: a category holds what Configurator reads or assembles (name, panel, heading, camera, triggerButton, options, value, mode / min / max, fieldLabel); everything passed to the child untouched goes in toggleGroup, itemsGrid or textArea. A configurator holds at most 12 categories.
Toggle and text panels
The metal toggle recolours the band. Typing an engraving moves the camera to the band preset, because the text category sets camera.
This 3D view needs WebGL, which this browser does not provide.
The 3D model could not be loaded.
Yellow gold
Choose your metal
Add an engraving
---
import Configurator from '@alfadormx/blocks/composite/Configurator.astro';
import type { ConfiguratorProps } from '@alfadormx/blocks/types/configurator';
const modelViewer: ConfiguratorProps['modelViewer'] = {
src: '/models/ring.glb',
label: 'A configurable ring',
class: 'rounded-lg bg-surface',
height: '320px',
cameraPresets: { band: { position: [0, -0.9, 2.4], target: [0, -0.6, 0], fov: 35 } },
};
const metalOptions = [
{
code: 'yellow',
label: 'Yellow gold',
selected: true,
mutations: [{ type: 'material', material: 'Band', color: '#e6b422', roughness: 0.3 }],
},
{
code: 'white',
label: 'White gold',
mutations: [{ type: 'material', material: 'Band', color: '#e5e4e2', roughness: 0.2 }],
},
{
code: 'rose',
label: 'Rose gold',
mutations: [{ type: 'material', part: 'Band', use: 'RoseGold' }],
},
] satisfies Extract<ConfiguratorProps['categories'][number], { panel: 'toggle' }>['options'];
const categories: ConfiguratorProps['categories'] = [
{
name: 'configurator-doc-metal',
panel: 'toggle',
triggerButton: { label: 'Metal' },
heading: 'Choose your metal',
options: metalOptions,
},
{
name: 'configurator-doc-engraving',
panel: 'text',
triggerButton: { label: 'Engraving' },
heading: 'Add an engraving',
camera: 'band',
textArea: { maxLength: 20, placeholder: 'Up to 20 characters' },
},
];
---
<Configurator categories={categories} modelViewer={modelViewer} />Grid panels
A 'single' grid switches which stone is visible. A 'multiple' grid with max: 2 disables the remaining option once two are selected.
This 3D view needs WebGL, which this browser does not provide.
The 3D model could not be loaded.
0.5 ct
Choose a stone size
Add up to two extras
---
import Configurator from '@alfadormx/blocks/composite/Configurator.astro';
import type { ConfiguratorProps } from '@alfadormx/blocks/types/configurator';
const modelViewer: ConfiguratorProps['modelViewer'] = {
src: '/models/ring.glb',
label: 'A configurable ring',
class: 'rounded-lg bg-surface',
height: '320px',
cameraPresets: { band: { position: [0, -0.9, 2.4], target: [0, -0.6, 0], fov: 35 } },
};
const stoneOptions = [
{
code: 'small',
title: '0.25 ct',
mutations: [{ type: 'visible', parts: ['Stone_Small'] }],
},
{
code: 'medium',
title: '0.5 ct',
selected: true,
mutations: [{ type: 'visible', parts: ['Stone_Medium'] }],
},
{
code: 'large',
title: '1 ct',
mutations: [{ type: 'visible', parts: ['Stone_Large'] }],
},
] satisfies Extract<ConfiguratorProps['categories'][number], { panel: 'grid' }>['options'];
const categories: ConfiguratorProps['categories'] = [
{
name: 'configurator-doc-stone',
panel: 'grid',
mode: 'single',
triggerButton: { label: 'Stone' },
heading: 'Choose a stone size',
options: stoneOptions,
},
{
name: 'configurator-doc-extras',
panel: 'grid',
mode: 'multiple',
max: 2,
triggerButton: { label: 'Extras' },
heading: 'Add up to two extras',
options: [
{ code: 'giftbox', title: 'Gift box' },
{ code: 'certificate', title: 'Certificate' },
{ code: 'polish', title: 'Lifetime polish' },
],
},
];
---
<Configurator categories={categories} modelViewer={modelViewer} />Defaults layering
Each panel’s config is merged in three layers: the configurator’s internal defaults, then the block-level defaultToggleGroupConfig, defaultItemsGridConfig or defaultTextAreaConfig, then the category’s own toggleGroup, itemsGrid or textArea. The block-level defaults take any child prop except per-instance keys (id, name, anchorId), the fields Configurator fills from the category (toggle: group, label, labelledBy, options; grid: items, selection; text: group, label, hideLabel, value) and, in defaultTextAreaConfig, error. For example, intent (see One intent across panels) or maxLength and placeholder in defaultTextAreaConfig. A field set on a triggerButton applies in every state, so style the active tab through tabs.activeItemConfig. Triggers merge through Tabs: tabs.defaultItemConfig under every trigger, tabs.activeItemConfig over the active one, and each category’s triggerButton last. Here defaultToggleGroupConfig asks for radio rows, the style category overrides it with outline cells, and tabs.defaultItemConfig makes every tab small and ghost; the active tab keeps the outlined style from the internal tabs.activeItemConfig.
This 3D view needs WebGL, which this browser does not provide.
The 3D model could not be loaded.
Yellow gold · Classic
Radio rows from defaultToggleGroupConfig
Outline cells from this category’s config
---
import Configurator from '@alfadormx/blocks/composite/Configurator.astro';
import type { ConfiguratorProps } from '@alfadormx/blocks/types/configurator';
const modelViewer: ConfiguratorProps['modelViewer'] = {
src: '/models/ring.glb',
label: 'A configurable ring',
class: 'rounded-lg bg-surface',
height: '320px',
cameraPresets: { band: { position: [0, -0.9, 2.4], target: [0, -0.6, 0], fov: 35 } },
};
const metalOptions = [
{
code: 'yellow',
label: 'Yellow gold',
selected: true,
mutations: [{ type: 'material', material: 'Band', color: '#e6b422', roughness: 0.3 }],
},
{
code: 'white',
label: 'White gold',
mutations: [{ type: 'material', material: 'Band', color: '#e5e4e2', roughness: 0.2 }],
},
{
code: 'rose',
label: 'Rose gold',
mutations: [{ type: 'material', part: 'Band', use: 'RoseGold' }],
},
] satisfies Extract<ConfiguratorProps['categories'][number], { panel: 'toggle' }>['options'];
const categories: ConfiguratorProps['categories'] = [
{
name: 'configurator-doc-layered-metal',
panel: 'toggle',
triggerButton: { label: 'Metal' },
heading: 'Radio rows from defaultToggleGroupConfig',
options: metalOptions,
},
{
name: 'configurator-doc-layered-style',
panel: 'toggle',
triggerButton: { label: 'Style' },
heading: 'Outline cells from this category’s config',
options: [
{
code: 'classic',
label: 'Classic',
selected: true,
mutations: [{ type: 'model', src: '/models/ring.glb' }],
},
{ code: 'bold', label: 'Bold', mutations: [{ type: 'model', src: '/models/ring-alt.glb' }] },
],
toggleGroup: { appearance: 'cell', variant: 'outline' },
},
];
---
<Configurator
categories={categories}
modelViewer={modelViewer}
defaultToggleGroupConfig={{ appearance: 'radio' }}
tabs={{ defaultItemConfig: { size: 'sm', variant: 'ghost', intent: 'neutral' } }}
/>One intent across panels
intent colours the selected state and focus ring of every panel kind. Setting it in defaultToggleGroupConfig, defaultItemsGridConfig and defaultTextAreaConfig gives toggle, grid and text panels the same colour. Tabs aren’t panels: colour the active tab with tabs.activeItemConfig.
This 3D view needs WebGL, which this browser does not provide.
The 3D model could not be loaded.
Yellow gold · 0.5 ct
Choose your metal
Choose a stone size
Add an engraving
---
import Configurator from '@alfadormx/blocks/composite/Configurator.astro';
import type { ConfiguratorProps } from '@alfadormx/blocks/types/configurator';
const modelViewer: ConfiguratorProps['modelViewer'] = {
src: '/models/ring.glb',
label: 'A configurable ring',
class: 'rounded-lg bg-surface',
height: '320px',
cameraPresets: { band: { position: [0, -0.9, 2.4], target: [0, -0.6, 0], fov: 35 } },
};
const metalOptions = [
{
code: 'yellow',
label: 'Yellow gold',
selected: true,
mutations: [{ type: 'material', material: 'Band', color: '#e6b422', roughness: 0.3 }],
},
{
code: 'white',
label: 'White gold',
mutations: [{ type: 'material', material: 'Band', color: '#e5e4e2', roughness: 0.2 }],
},
{
code: 'rose',
label: 'Rose gold',
mutations: [{ type: 'material', part: 'Band', use: 'RoseGold' }],
},
] satisfies Extract<ConfiguratorProps['categories'][number], { panel: 'toggle' }>['options'];
const stoneOptions = [
{
code: 'small',
title: '0.25 ct',
mutations: [{ type: 'visible', parts: ['Stone_Small'] }],
},
{
code: 'medium',
title: '0.5 ct',
selected: true,
mutations: [{ type: 'visible', parts: ['Stone_Medium'] }],
},
{
code: 'large',
title: '1 ct',
mutations: [{ type: 'visible', parts: ['Stone_Large'] }],
},
] satisfies Extract<ConfiguratorProps['categories'][number], { panel: 'grid' }>['options'];
const categories: ConfiguratorProps['categories'] = [
{
name: 'configurator-doc-intent-metal',
panel: 'toggle',
triggerButton: { label: 'Metal' },
heading: 'Choose your metal',
options: metalOptions,
},
{
name: 'configurator-doc-intent-stone',
panel: 'grid',
mode: 'single',
triggerButton: { label: 'Stone' },
heading: 'Choose a stone size',
options: stoneOptions,
},
{
name: 'configurator-doc-intent-engraving',
panel: 'text',
triggerButton: { label: 'Engraving' },
heading: 'Add an engraving',
textArea: { maxLength: 20 },
},
];
---
<Configurator
categories={categories}
modelViewer={modelViewer}
defaultToggleGroupConfig={{ intent: 'accent' }}
defaultItemsGridConfig={{ intent: 'accent' }}
defaultTextAreaConfig={{ intent: 'accent' }}
tabs={{ activeItemConfig: { intent: 'accent' } }}
/>Neutral intent
neutral selects with the emphasis colour in every panel kind.
This 3D view needs WebGL, which this browser does not provide.
The 3D model could not be loaded.
Yellow gold · 0.5 ct
Choose your metal
Choose a stone size
Add an engraving
---
import Configurator from '@alfadormx/blocks/composite/Configurator.astro';
import type { ConfiguratorProps } from '@alfadormx/blocks/types/configurator';
const modelViewer: ConfiguratorProps['modelViewer'] = {
src: '/models/ring.glb',
label: 'A configurable ring',
class: 'rounded-lg bg-surface',
height: '320px',
cameraPresets: { band: { position: [0, -0.9, 2.4], target: [0, -0.6, 0], fov: 35 } },
};
const metalOptions = [
{
code: 'yellow',
label: 'Yellow gold',
selected: true,
mutations: [{ type: 'material', material: 'Band', color: '#e6b422', roughness: 0.3 }],
},
{
code: 'white',
label: 'White gold',
mutations: [{ type: 'material', material: 'Band', color: '#e5e4e2', roughness: 0.2 }],
},
{
code: 'rose',
label: 'Rose gold',
mutations: [{ type: 'material', part: 'Band', use: 'RoseGold' }],
},
] satisfies Extract<ConfiguratorProps['categories'][number], { panel: 'toggle' }>['options'];
const stoneOptions = [
{
code: 'small',
title: '0.25 ct',
mutations: [{ type: 'visible', parts: ['Stone_Small'] }],
},
{
code: 'medium',
title: '0.5 ct',
selected: true,
mutations: [{ type: 'visible', parts: ['Stone_Medium'] }],
},
{
code: 'large',
title: '1 ct',
mutations: [{ type: 'visible', parts: ['Stone_Large'] }],
},
] satisfies Extract<ConfiguratorProps['categories'][number], { panel: 'grid' }>['options'];
const categories: ConfiguratorProps['categories'] = [
{
name: 'configurator-doc-intent-neutral-metal',
panel: 'toggle',
triggerButton: { label: 'Metal' },
heading: 'Choose your metal',
options: metalOptions,
},
{
name: 'configurator-doc-intent-neutral-stone',
panel: 'grid',
mode: 'single',
triggerButton: { label: 'Stone' },
heading: 'Choose a stone size',
options: stoneOptions,
},
{
name: 'configurator-doc-intent-neutral-engraving',
panel: 'text',
triggerButton: { label: 'Engraving' },
heading: 'Add an engraving',
textArea: { maxLength: 20 },
},
];
---
<Configurator
categories={categories}
modelViewer={modelViewer}
defaultToggleGroupConfig={{ intent: 'neutral', variant: 'solid' }}
defaultItemsGridConfig={{ intent: 'neutral' }}
defaultTextAreaConfig={{ intent: 'neutral' }}
tabs={{ activeItemConfig: { intent: 'neutral' } }}
/>Summary
The line under the viewer is derived from the current selections. By default it lists the label of every selected option: toggle options by label, grid options by title (falling back to code). Categories appear in tab order and options in declaration order, whatever order they were picked in. Text is shown in quotes, empty categories are skipped, and the parts are joined with ·. summary.categories and summary.separator change which categories are listed, their order and the joiner (see Title, summary and actions). The summary is an aria-live="polite" region, so screen readers announce changes.
URL state
Set urlState to keep the selections in the page URL as a combination code, so a configuration can be shared or bookmarked and the back button steps through changes. The code lists the categories in tab order, with an optional leading product segment; the query parameter defaults to code and can be changed with param. Only the first configurator with urlState on a page binds to the URL, so this page leaves it off.
Append categories only. Once codes are shared, never remove or reorder categories, or old codes will decode into the wrong groups. Option codes and product must match [A-Za-z0-9]+.
<Configurator categories={categories} modelViewer={modelViewer} urlState={{ product: 'RING01' }} />
<!-- ?code=RING01-bold-large-rose-vvs1-giftbox-Mia -->
Title, summary and actions
headline.title names the product under the viewer, and actions renders Buttons under the summary line. summary.categories picks which categories the summary lists and in which order, summary.separator joins them, and summaryClass styles the line. URL state and the viewer still use every category. Here the summary lists only the stone, so the metal is left out of it.
This 3D view needs WebGL, which this browser does not provide.
The 3D model could not be loaded.
Solitaire
0.5 ct
Choose your metal
Choose a stone size
---
import Configurator from '@alfadormx/blocks/composite/Configurator.astro';
import type { ConfiguratorProps } from '@alfadormx/blocks/types/configurator';
const modelViewer: ConfiguratorProps['modelViewer'] = {
src: '/models/ring.glb',
label: 'A configurable ring',
class: 'rounded-lg bg-surface',
height: '320px',
cameraPresets: { band: { position: [0, -0.9, 2.4], target: [0, -0.6, 0], fov: 35 } },
};
const metalOptions = [
{
code: 'yellow',
label: 'Yellow gold',
selected: true,
mutations: [{ type: 'material', material: 'Band', color: '#e6b422', roughness: 0.3 }],
},
{
code: 'white',
label: 'White gold',
mutations: [{ type: 'material', material: 'Band', color: '#e5e4e2', roughness: 0.2 }],
},
{
code: 'rose',
label: 'Rose gold',
mutations: [{ type: 'material', part: 'Band', use: 'RoseGold' }],
},
] satisfies Extract<ConfiguratorProps['categories'][number], { panel: 'toggle' }>['options'];
const categories: ConfiguratorProps['categories'] = [
{
name: 'configurator-doc-framed-metal',
panel: 'toggle',
triggerButton: { label: 'Metal' },
heading: 'Choose your metal',
options: metalOptions,
},
{
name: 'configurator-doc-framed-stone',
panel: 'grid',
mode: 'single',
triggerButton: { label: 'Stone' },
heading: 'Choose a stone size',
options: [
{ code: 'small', title: '0.25 ct', mutations: [{ type: 'visible', parts: ['Stone_Small'] }] },
{
code: 'medium',
title: '0.5 ct',
selected: true,
mutations: [{ type: 'visible', parts: ['Stone_Medium'] }],
},
{ code: 'large', title: '1 ct', mutations: [{ type: 'visible', parts: ['Stone_Large'] }] },
],
},
];
---
<Configurator
categories={categories}
modelViewer={modelViewer}
headline={{ title: 'Solitaire' }}
summary={{ categories: ['configurator-doc-framed-stone'], separator: ' ' }}
summaryClass="mt-1 text-sm uppercase tracking-widest text-muted"
actions={[{ label: 'Save my design', variant: 'outline', intent: 'neutral' }]}
/>Headline and shared action config
headline renders a full Headline under the viewer. defaultActionConfig is merged under every action, and actionsClass styles the wrapper around them. Style the left column through twoColumnContainer.leftColumn.class and the panels through tabs.panelClass. Set tabs.tabList.sticky to keep the tab bar in view under a sticky Header; add md:top-0 to tabs.tabList.wrapperClass when the right column becomes its own scroll box from md up.
This 3D view needs WebGL, which this browser does not provide.
The 3D model could not be loaded.
Ring
Solitaire
Hand-set in Antwerp
Yellow gold
Choose your metal
---
import Configurator from '@alfadormx/blocks/composite/Configurator.astro';
import type { ConfiguratorProps } from '@alfadormx/blocks/types/configurator';
const modelViewer: ConfiguratorProps['modelViewer'] = {
src: '/models/ring.glb',
label: 'A configurable ring',
class: 'rounded-lg bg-surface',
height: '320px',
cameraPresets: { band: { position: [0, -0.9, 2.4], target: [0, -0.6, 0], fov: 35 } },
};
const metalOptions = [
{
code: 'yellow',
label: 'Yellow gold',
selected: true,
mutations: [{ type: 'material', material: 'Band', color: '#e6b422', roughness: 0.3 }],
},
{
code: 'white',
label: 'White gold',
mutations: [{ type: 'material', material: 'Band', color: '#e5e4e2', roughness: 0.2 }],
},
{
code: 'rose',
label: 'Rose gold',
mutations: [{ type: 'material', part: 'Band', use: 'RoseGold' }],
},
] satisfies Extract<ConfiguratorProps['categories'][number], { panel: 'toggle' }>['options'];
const categories: ConfiguratorProps['categories'] = [
{
name: 'configurator-doc-headline-metal',
panel: 'toggle',
triggerButton: { label: 'Metal' },
heading: 'Choose your metal',
options: metalOptions,
},
];
---
<Configurator
categories={categories}
modelViewer={modelViewer}
headline={{ tagline: 'Ring', title: 'Solitaire', subtitle: 'Hand-set in Antwerp' }}
defaultActionConfig={{ variant: 'outline', intent: 'neutral' }}
actionsClass="flex"
actions={[{ label: 'Save my design' }, { label: 'Share' }]}
/>Heading and field label
headingClass adds classes to every panel heading, after its defaults. A text category with fieldLabel shows that label above its field, while the heading stays the panel’s name. A category without triggerButton uses its heading as the tab label, as the metal tab here does; set triggerButton: { label: 'Metal' } for a short tab.
This 3D view needs WebGL, which this browser does not provide.
The 3D model could not be loaded.
Yellow gold
Choose your metal
Engrave your ring
---
import Configurator from '@alfadormx/blocks/composite/Configurator.astro';
import type { ConfiguratorProps } from '@alfadormx/blocks/types/configurator';
const modelViewer: ConfiguratorProps['modelViewer'] = {
src: '/models/ring.glb',
label: 'A configurable ring',
class: 'rounded-lg bg-surface',
height: '320px',
cameraPresets: { band: { position: [0, -0.9, 2.4], target: [0, -0.6, 0], fov: 35 } },
};
const metalOptions = [
{
code: 'yellow',
label: 'Yellow gold',
selected: true,
mutations: [{ type: 'material', material: 'Band', color: '#e6b422', roughness: 0.3 }],
},
{
code: 'white',
label: 'White gold',
mutations: [{ type: 'material', material: 'Band', color: '#e5e4e2', roughness: 0.2 }],
},
{
code: 'rose',
label: 'Rose gold',
mutations: [{ type: 'material', part: 'Band', use: 'RoseGold' }],
},
] satisfies Extract<ConfiguratorProps['categories'][number], { panel: 'toggle' }>['options'];
const categories: ConfiguratorProps['categories'] = [
{
name: 'configurator-doc-heading-metal',
panel: 'toggle',
heading: 'Choose your metal',
options: metalOptions,
},
{
name: 'configurator-doc-heading-engraving',
panel: 'text',
triggerButton: { label: 'Engraving' },
heading: 'Engrave your ring',
fieldLabel: 'Engraving',
textArea: { maxLength: 20, placeholder: 'Up to 20 characters' },
},
];
---
<Configurator
categories={categories}
modelViewer={modelViewer}
headingClass="text-xs uppercase tracking-[0.2em]"
/>Extra field description
A native aria-describedby in textArea is added after the field’s own help and counter.
Engraving takes two working days.
This 3D view needs WebGL, which this browser does not provide.
The 3D model could not be loaded.
Add an engraving
Engraved in capitals.
0 / 20
---
import Configurator from '@alfadormx/blocks/composite/Configurator.astro';
import type { ConfiguratorProps } from '@alfadormx/blocks/types/configurator';
const modelViewer: ConfiguratorProps['modelViewer'] = {
src: '/models/ring.glb',
label: 'A configurable ring',
class: 'rounded-lg bg-surface',
height: '320px',
cameraPresets: { band: { position: [0, -0.9, 2.4], target: [0, -0.6, 0], fov: 35 } },
};
const categories: ConfiguratorProps['categories'] = [
{
name: 'configurator-doc-described-engraving',
panel: 'text',
heading: 'Add an engraving',
textArea: {
help: 'Engraved in capitals.',
maxLength: 20,
showCounter: true,
'aria-describedby': 'configurator-doc-engraving-note',
},
},
];
---
<p id="configurator-doc-engraving-note">Engraving takes two working days.</p>
<Configurator categories={categories} modelViewer={modelViewer} />Panel layout
tabs.panelClass lays out each panel’s heading and control, which are its direct children.
This 3D view needs WebGL, which this browser does not provide.
The 3D model could not be loaded.
Yellow gold
Choose your metal
Add an engraving
---
import Configurator from '@alfadormx/blocks/composite/Configurator.astro';
import type { ConfiguratorProps } from '@alfadormx/blocks/types/configurator';
const modelViewer: ConfiguratorProps['modelViewer'] = {
src: '/models/ring.glb',
label: 'A configurable ring',
class: 'rounded-lg bg-surface',
height: '320px',
cameraPresets: { band: { position: [0, -0.9, 2.4], target: [0, -0.6, 0], fov: 35 } },
};
const metalOptions = [
{
code: 'yellow',
label: 'Yellow gold',
selected: true,
mutations: [{ type: 'material', material: 'Band', color: '#e6b422', roughness: 0.3 }],
},
{
code: 'white',
label: 'White gold',
mutations: [{ type: 'material', material: 'Band', color: '#e5e4e2', roughness: 0.2 }],
},
{
code: 'rose',
label: 'Rose gold',
mutations: [{ type: 'material', part: 'Band', use: 'RoseGold' }],
},
] satisfies Extract<ConfiguratorProps['categories'][number], { panel: 'toggle' }>['options'];
const categories: ConfiguratorProps['categories'] = [
{
name: 'configurator-doc-panel-class-metal',
panel: 'toggle',
triggerButton: { label: 'Metal' },
heading: 'Choose your metal',
options: metalOptions,
},
{
name: 'configurator-doc-panel-class-engraving',
panel: 'text',
triggerButton: { label: 'Engraving' },
heading: 'Add an engraving',
textArea: { maxLength: 20 },
},
];
---
<Configurator
categories={categories}
modelViewer={modelViewer}
headingClass="mb-0"
tabs={{ panelClass: 'flex flex-col gap-4' }}
/>API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| categories | ConfiguratorCategory[] | — | Categories in tab order; each becomes one tab and one selection group. A category holds identity (`name`, `heading`, `camera`, `triggerButton`), content (`options`, `value`, `fieldLabel`) and selection semantics (`mode` / `min` / `max`). Appearance goes in `toggleGroup`, `itemsGrid` or `textArea`, including grid `intent`. At most 12 (one static panel slot each). |
| modelViewer | Omit<ModelViewerProps, 'selections'> | — | ModelViewer props; `selections` is built from the categories' options and cameras. |
| defaultItemsGridConfig | LayerConfig<ConfiguratorItemsGrid> | — | ItemsGrid config merged under every grid category's `itemsGrid` (default: { columns: 3, gap: 'tight' }). |
| defaultToggleGroupConfig | LayerConfig<ConfiguratorToggleGroup> | — | ToggleGroup config merged under every toggle category's `toggleGroup` (default: { appearance: 'cell' }). |
| defaultTextAreaConfig | LayerConfig<Omit<ConfiguratorTextArea, 'error'>> | — | TextArea config merged under every text category's `textArea`; `error` is per category (default: { rows: 2 }). |
| tabs | Omit<TabsProps, 'items'> | — | Tabs config for the choice panel; style every trigger with `tabs.defaultItemConfig`, and set `tabs.tabList.sticky` to keep the tab bar below a sticky Header (default: grid tab list, full-width triggers, outlined primary active tab). |
| twoColumnContainer | TwoColumnContainerProps | — | TwoColumnContainer for the two panes (default: { responsive: true }). |
| urlState | { product?: string; param?: string } | — | Keeps selections in the URL as a combination code. Category order is the code's group order: append new categories only, never remove or reorder them once codes are shared. Only the first configurator with urlState on a page binds to the URL. |
| headingClass | string | '' | Classes on every panel heading, after its defaults (default: 'mb-4 text-lg font-semibold'). |
| headline | HeadlineProps | — | Headline under the viewer (default: { class: 'mt-6 mb-0', titleClass: 'text-2xl font-semibold' }) |
| actions | ButtonProps[] | [] | Buttons rendered under the summary line (default: []). |
| defaultActionConfig | LayerConfig<ButtonProps> | — | Button config merged under every entry in `actions` |
| actionsClass | string | — | Custom classes for the wrapper around the action buttons (default: 'mt-6 inline-flex flex-wrap gap-3') |
| summary | SummaryFormat | — | Summary line under the viewer: listed categories and separator (default: every category, ' · '). URL state and the viewer still use every category. |
| summaryClass | string | — | Custom classes for the summary line (default: 'mt-4 text-lg'). |
| class | string | '' | Extra classes on the configurator root. |