palantir/blueprint

Generically typed selection UI

Open

#6.695 geöffnet am 1. Feb. 2024

Auf GitHub ansehen
 (0 Kommentare) (2 Reaktionen) (0 zugewiesene Personen)TypeScript (20.263 Stars) (2.167 Forks)batch import
Status: needs proposalType: feature requesthelp wanted

Beschreibung

Feature request

Would be nice to have a selection UI that works with enums. SegmentedControl is nice but the callback is always string

Examples

const options: {label: string, value: MyEnum} = {...};

const handleValueChange = (newValue: MyEnum) => {...};

... 

<SegmentedControl<MyEnum> options={options} onValueChange={handleValueChange}>
...
</SegmentedControl>

Contributor Guide