SimpleSelect
SimpleSelect is a lightweight component designed to act as a <select> or a dropdown without filtering functionality. It supports single and multiple selection modes, as well as grouping and controlled states.
Internal Component
This component is intended solely for use within GitHub and is not available for external use.Props
SimpleSelect
| Name | Default | Description |
|---|---|---|
selectionVariant Required | single | "single" | "multiple"Whether multiple items can be selected |
items Required | Items[]Array of selectable items | |
onSelect | ((selectedItem: Items) => void) | undefinedCallback when an item is selected | |
selectable | ((items: Items[]) => void) | undefinedCallback for controlled selection state | |
buttonProps | undefined | ButtonPropsProps for customizing the trigger button |
outsideClick | save | "save" | "cancel" | undefinedAction to take when clicking outside - either save or cancel |
onEscape | save | "save" | "cancel" | undefinedAction to take when escape is pressed - either save or cancel |
title | Select an item | stringDialog title |
focusTarget | first-target | "first-item" | "first-target" | undefinedWhich element should receive initial focus |
footerButtons | FooterButtons[] | undefinedCustom footer buttons | |
label | stringStatic text label | |
renderText | (() => ReactNode) | undefinedCustom render function for the label | |
variant | overlay | "overlay" | "modal" | undefinedUse overlay presentation Use modal presentation |
dialogProps | SimpleSelectDialogPropsProps to customize the modal dialog | |
onSave | ((items: Items[]) => void) | undefinedSave callback is optional if no footer is needed Callback when selection is saved | |
onCancel | ((items: Items[]) => void) | undefinedCancel callback is optional if no footer is needed Callback when selection is cancelled |