Preference Strength Selector

A three-position segmented control for expressing preference strength: Required, Preferred, or Any. Built on Radix ToggleGroup. Active item uses inverted foreground/background. Labels are fully customisable.

core/preference-strength-selector

Installation

1 · Add registry to components.json

2 · Install component

Examples

Default

Default labels, custom label override, and disabled state.

API Reference

PropTypeDescription
valuereq
PreferenceStrengthControlled value: "required" | "preferred" | "any".
onChangereq
(value: PreferenceStrength) => voidCalled when the selected strength changes.
labels
Partial<Record<PreferenceStrength, string>>Override display labels. Defaults: Required / Preferred / Any.
disabled
booleanDisables the entire control.
className
stringAdditional classes applied to the toggle group.