palantir/blueprint

Generically typed selection UI

Open

#6695 aperta il 1 feb 2024

Vedi su GitHub
 (0 commenti) (2 reazioni) (0 assegnatari)TypeScript (2167 fork)batch import
Status: needs proposalType: feature requesthelp wanted

Metriche repository

Star
 (20.263 star)
Metriche merge PR
 (Merge medio 24g 18h) (17 PR mergiate in 30 g)

Descrizione

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>

Guida contributor