Saltar al contenido
El Muestrario

componente · @solu30/ui-kit/input

Select

El componente, montado

Cargando el espécimen…

Cargando el chunk del paquete instalado…

De dónde se importa

import { Select } from '@solu30/ui-kit/input'

Props

17 props declaradas en los tipos de la versión instalada.
PropRequeridaTipoQué hace
labelopcionalstringLabel for the select
valueTCurrently selected value
optionsSelectOption<T>[]Available options
onChange(option: SelectOption<T>) => voidCallback when selection changes
placeholderopcionalstringPlaceholder when nothing is selected
disabledopcionalbooleanWhether the select is disabled
classNameopcionalstringAdditional CSS class
erroropcionalstringError message to display
helpTextopcionalstringHelp text to display below the select
fullWidthopcionalbooleanWhether the select should take full width
clearableopcionalbooleanWhether the select allows clearing the selection
onClearopcional() => voidCallback when selection is cleared
searchThresholdopcionalnumberMinimum options count to show the search input (default: 10)
searchPlaceholderopcionalstringPlaceholder for the search input
noResultsTextopcionalstringText shown when no options match the search
ariaLabelopcionalstringAccessible name when there is no visible `label`. A11y: `role="combobox"` does NOT take its name from content, so a Select without `label` and without this prop is announced as an unnamed combobox. Pass one whenever the field's purpose lives in surrounding layout (toolbar filters, inline table editors) instead of a visible label.
clearLabelopcionalstringAccessible name for the clear (×) affordance. Only rendered when `clearable`.

Ejemplo del paquete

<Select
label="Status"
value={status}
options={[
{ id: 'active', name: 'Active' },
{ id: 'inactive', name: 'Inactive' }
]}
onChange={handleChange}
/>
<Select<number>
label="Category"
value={categoryId}
options={categories}
onChange={handleCategoryChange}
error="Must select a category"
clearable
/>

Del @example del JSDoc de @solu30/ui-kit, sin editar. Cuatro de los 69 ejemplos del paquete traen pegada la firma cruda del .d.ts —el mismo defecto del extractor que se come las descripciones—, y por eso la caja tiene tope de alto: el ejemplo de verdad suele estar al final.