Filter group
Filter buttons
Use EuiFilterGroup to wrap EuiFilterButtons into a container that looks nice against form fields (like search). These buttons are used in two different patterns. The most simplest use is that of an on/off pattern to show whether a filter is on. Add the prop withNext
to remove the border between it and the next EuiFilterButton to visually group similar or opposite style filters.
Add the prop withNext
to remove the border between it and the next EuiFilterButton to visually group similar or opposite style filters.
Set hasActiveFilters
to true when the filter is active.
Multi-select
To provide a long list of grouped filters, we recommend wrapping the filter button within an EuiPopover and passing the items to a searchable EuiSelectable.
Indicating number of filters
By passing a number to numFilters
you can express the number of filters available. When the user has applied these filter add the prop hasActiveFilters
as before and this will change the coloring of the indicator. You can also supply a number to numActiveFilters
which will change the number displayed.
Layout
By default, the bar is auto-widthed based on its contents. To expand the bar to fill its parent's width add fullWidth
. This will also set each button to grow. If you do not want the button to grow, set grow=false
.
Props
EuiFilterGroup
Prop | Description and type | Default value |
---|---|---|
Prop className# | Description and type Type: string | Default value |
Prop aria-label# | Description and type Defines a string value that labels the current element. string | Default value |
Prop data-test-subj# | Description and type Type: string | Default value |
Prop css# | Description and type Type: Interpolation<Theme> | Default value |
Prop fullWidth# | Description and type Expand the whole bar to fill its parent's width boolean | Default value false |
Prop compressed# | Description and type When boolean | Default value |
EuiFilterButton
Prop | Description and type | Default value |
---|---|---|
Prop hasActiveFilters# | Description and type Bolds the button if true boolean | Default value |
Prop numFilters# | Description and type Pass the total number of filters available and it will number | Default value |
Prop numActiveFilters# | Description and type Pass the number of selected filters and it will number | Default value |
Prop isSelected# | Description and type Applies a visual state to the button useful when using with a popover. boolean | Default value |
Prop grow# | Description and type Should the button grow to fill its container, best used for dropdown buttons boolean | Default value true |
Prop withNext# | Description and type Remove border after button, good for opposite filters boolean | Default value |
Prop badgeColor# | Description and type Change color of the counter badge "accent" | "success" | "subdued" | Default value accent |
Prop color# | Description and type Any of the named color palette options. "text" | "accent" | "primary" | "success" | "warning" | "danger" | Default value text |
Prop target# | Description and type Type: string | Default value |
Prop rel# | Description and type Type: string | Default value |
Prop className# | Description and type Type: string | Default value |
Prop css# | Description and type Type: Interpolation<Theme> | Default value |
Prop isLoading# | Description and type Force disables the button and changes the icon to a loading spinner boolean | Default value |
Prop contentProps# | Description and type Object of props passed to the CommonProps & EuiButtonDisplayContentType | Default value |
Prop type# | Description and type Type: "button" | "reset" | "submit" | Default value button |
Prop iconType# | Description and type Any IconType | Default value |
Prop iconSide# | Description and type Can only be one side ButtonContentIconSide | Default value right |
Prop textProps# | Description and type Object of props passed to the This span wrapper can be removed by passing false | (HTMLAttributes<HTMLSpanElement> & CommonProps & { ref?: Ref<HTMLSpanElement>; 'data-text'?: string; }) | Default value |
Prop iconSize# | Description and type Type: "s" | "m" | Default value |
Prop isDisabled# | Description and type
boolean | Default value |
Prop aria-label# | Description and type Defines a string value that labels the current element. string | Default value |
Prop data-test-subj# | Description and type Type: string | Default value |
Prop href# | Description and type Type: string | Default value |
Prop onClick# | Description and type Type: MouseEventHandler<HTMLAnchorElement> | MouseEventHandler<HTMLButtonElement> | Default value |
Prop buttonRef# | Description and type Type: Ref<HTMLAnchorElement | HTMLButtonElement> | Default value |