Skip to content
OTF Kit logoOTF Kit

Variant Picker

Input

Single-select product-option swatches (grind, size, color) with selected + out-of-stock states.

View in Storybook
Variant Picker
Loading Storybook preview…

Installation

bun add @otfdashkit/ui

Usage

Import VariantPicker from @otfdashkit/ui.

Code
// Variant Picker — Single-select product-option swatches (grind, size, color) with selected + out-of-stock states.
//
// Install:
//   bun add @otfdashkit/ui

import { VariantPicker } from '@otfdashkit/ui'

export function Example() {
  return (
    <VariantPicker>
      {/* your content */}
    </VariantPicker>
  )
}

Props

Props declared in the VariantPicker source. Inherited HTML attributes are not listed.

PropTypeDefaultDescription
optionsrequiredVariantOption[]
defaultValuestring | (readonly string[] & string)Uncontrolled initial value.
labelstringGroup label, e.g. "Grind" or "Size".
onValueChange(value: string) => void
valuestringControlled selected value.

Related