@rubenpazch/select
v1.5.4
Published
Select component for Lbyte UI library
Readme
@rubenpazch/select
Lista desplegable simple con etiqueta, placeholder y error.
- Usar cuando: Elegir una opción entre una lista corta y conocida.
- Evitar cuando: Listas largas o con búsqueda: usa Autocomplete.
Se recomienda instalar el paquete completo @rubenpazch/ui (incluye este). Por separado:
npm install @rubenpazch/selectSelect
| Prop | Tipo | Req. | Por defecto | Descripción |
| ------------- | --------------------------------------------------------- | ---- | ----------- | ---------------------------------------------------------------------------------------------------------------- |
| onChange | (value: string) => void | sí | | |
| options | SelectOption[] | sí | | |
| value | string | sí | | |
| className | string | | | |
| disabled | boolean | | false | |
| error | string | | | |
| hint | string | | | Texto de ayuda bajo el campo. |
| id | string | | | |
| label | string | | | |
| labelAction | ReactNode | | | Contenido junto a la etiqueta, a la derecha: un botón de ayuda ("?"), un enlace… No va dentro del <label>. |
| name | string | | | |
| onBlur | (event: FocusEvent<HTMLSelectElement, Element>) => void | | | |
| onFocus | (event: FocusEvent<HTMLSelectElement, Element>) => void | | | |
| placeholder | string | | | |
| required | boolean | | false | |
| size | "sm" \| "md" \| "lg" \| "small" \| "medium" \| "large" | | | Tamaño: sm (en filas compactas, p. ej. dentro de un panel), md (por defecto) o lg; también small, medium, large. |
| warning | string | | | Advertencia que no bloquea el envío; no se muestra si hay error. |
Tipos: SelectOption, SelectProps, SelectSize.
