palantir/blueprint

Generically typed selection UI

Offen

#6.695 geöffnet am 01.02.2024

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

Repository-Metriken

Stars
 (20.263 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

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