MaterialSelector
Option picker for finishes and materials with swatch and tile presentations.
Best for
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.
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
Component Sets
Preview the first example across the available component-set presets to compare tone, spacing, and structural defaults.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| options | MaterialOption[] | — | No description yet. |
| selected | string | — | No description yet. |
| onChange | (value: string) => void | — | No description yet. |
| className | string | — | No description yet. |
| classNames | Partial<Record<MaterialSelectorSlot, string>> | — | No description yet. Slot keys headeroptiontitlegrouprootselectionLabelmedia |
| variant | string | swatch | No description yet. |
| title | string | — | No description yet. |
| showSelectionLabel | boolean | false | No description yet. |
| ariaLabel | string | Select material | No description yet. |
| tileSize | string | — | No description yet. |