Filter
A resuable filter component that can provide suggestions and validation to users. It generates a consistant search string that can be used to query data.
Internal Component
This component is intended solely for use within GitHub and is not available for external use.Props
Filter
| Name | Default | Description |
|---|---|---|
id Required | stringID of the Filter Component | |
className | stringCSS class to apply at the root element of the component | |
onChange | (value: string) => voidChange event callback, passing the updated filter value | |
onParse | (request: FilterQuery) => voidEvent callback, triggered by the filter query being parsed, and passing the updated filter query request | |
onSubmit | (request: FilterQuery, eventType: SubmitEvent) => voidSubmit event callback, triggered by Enter or pressing Submit, and passing the updated filter query and the originating event type | |
providers Required | any[]Array of FilterProviders and NestedFilterProviders that are being used/supported | |
advancedFilterDialogRef | React.RefObject<AdvancedFilterDialogRef>React Ref to the input element | |
context | Record<string, string>Context to be applied for all API queries | |
filterButtonVariant | FilterButtonVariantVariant of the filter button, whether to show the title or just the icon | |
initialFilterValue | stringInitial value to use for the input. DO NOT USE in conjunction with | |
filterValue | stringSupplied filter value to use. By using this, the Filter is externally controlled and will not use it's own state. | |
inputRef | React.RefObject<HTMLInputElement>React Ref to the input element | |
label Required | stringLabel displayed atop the Filter bar. This is only shown when | |
onKeyDown | React.KeyboardEventHandler<Element>Input keydown event callback | |
onValidation | (messages: string[], filterQuery: FilterQuery) => voidValidation callback, passing the validation message and the validation query | |
placeholder | stringPlaceholder text for the input | |
settings | FilterSettingsSettings for the Filter, such as support of the legacy No filter provider and alias matching | |
showClearButton | booleanWhether or not the clear query button should be shown. Defaults to true | |
showValidationMessage | booleanWhether to show any validation messages or not. If this is disabled, use | |
trailingVisual | React.ReactElement<any, string | React.JSXElementConstructor<any>>Add a trailing visual element after the input but before the clear button | |
variant | FilterVariantVariant of the Filter to render. | |
visuallyHideLabel | booleanWhether to visually hide the Label or not |