Theme Playground

Commerce

MaterialSelector

Option picker for finishes and materials with swatch and tile presentations.

Best for

finish selectionmaterial galleriesproduct configuration

Import

import { MaterialSelector } from "@enadhq/enad-react-sdk/client/storefront"

When to use it

Use MaterialSelector when the product has a small set of mutually exclusive finish or surface options and the selector should feel more intentional than a plain dropdown.

Choose swatches for speed and density. Choose tiles when the option differences are visual enough to justify images or larger labels.

Composition notes

selected and onChange are the core state pair. variant="swatch" favors compact picking, while variant="tile" gives each option more presence.

Use title and showSelectionLabel when the surrounding product page needs a little more context about the current choice.

Use tileSize when tile mode needs a specific square footprint, and classNames when the app needs slot-level control over the root, header, group, option, or media styling.

Behavior and theming guidance

Keep the number of options reasonable. When there are too many finish choices, a different browsing pattern may be easier to use.

The selector works best when option naming, imagery, and selection feedback all line up clearly. Avoid mixing vague labels with visually similar materials.

For branded PDPs, prefer styling the tile through tileSize and classNames before rebuilding the selector locally. That keeps accessibility and interaction behavior consistent across apps.

Examples

Live examples you can edit directly in the sandbox.

3 examples

Swatch selector

Use the swatch mode when the finish can be communicated well through compact color chips.

Tile selector

Use tile mode when each option benefits from imagery and a little more merchandising context.

Large color-only tiles

Use the tile sizing hook when color-only options should stay large and square without a local adapter.

Slots

headeroptiontitlegrouprootselectionLabelmedia

Component Sets

Preview the first example across the available component-set presets to compare tone, spacing, and structural defaults.

Props

PropTypeDefaultDescription
optionsMaterialOption[]
No description yet.
selectedstring
No description yet.
onChange(value: string) => void
No description yet.
classNamestring
No description yet.
classNamesPartial<Record<MaterialSelectorSlot, string>>
No description yet.
Slot keys
headeroptiontitlegrouprootselectionLabelmedia
variantstringswatch
No description yet.
titlestring
No description yet.
showSelectionLabelbooleanfalse
No description yet.
ariaLabelstringSelect material
No description yet.
tileSizestring
No description yet.