Resumen
SearchInput proporciona un icono de búsqueda y un campo de entrada de texto. onValueChange recibe la nueva cadena; onChange recibe el evento nativo de cambio de React. El filtrado, la obtención y la eliminación de rebotes pertenecen a tu aplicación.
Uso
aria-label o aria-labelledby para un nombre accesible.
Las propiedades nativas de entrada, className, style y ref se aplican al propio campo de entrada. El InputGroup compartido se encarga del elemento decorativo de búsqueda y del tratamiento del foco. El contenedor que distribuye el campo y sus acciones no acepta props; coloca SearchInput en tu propio contenedor para cambiar su tamaño o posición. Usa size="sm" para un campo de búsqueda compacto.
Acciones
actions muestra controles después del campo de búsqueda. Compón una ventana emergente de filtro con un Dropdown cuyo activador sea un IconButton y asigna a ese botón un nombre accesible.
disabled desactiva solo la entrada de texto; desactiva los controles de acción por separado. Con size="sm", pasa size="sm" también a los controles de acción.
”Props”
Controls rendered after the search field, such as a filter Dropdown. Set their size and accessible names on the controls.
Shows the group focus border. Defaults to false for all search inputs. Set true to opt in. Error styling remains visible.
Native input change event handler.
((value: string, eventDetails: { reason: "none"; event: Event; cancel: () => void; allowPropagation: () => void; isCanceled: boolean; isPropagationAllowed: boolean; trigger: Element | undefined; }) => void)
Called with the new text. The application owns filtering.
Hint shown when the input is empty. Also used as the accessible name if no explicit label is supplied.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, InputState>
Allows you to replace the component’s HTML element
with a different tag, or compose it with another component.Accepts a
ReactElement or a function that returns the element to render.Style applied to the element, or a function that
returns a style object based on the component’s state.