Skip to main content
Version: Next 🚧

FiltersBarComponent

The FiltersBarComponent displays all active filters as buttons, provides clear-all and basket management, and handles overflow. It acts as the main UI for interacting with applied filters.

Features​

  • Displays all active filters as buttons
  • Supports clearing all filters or basket
  • Integrates with aggregations and advanced filters
  • Handles overflow with a "More" button for additional filters

Usages​

Basic Example​

sample.component.ts
import { FiltersBarComponent } from "@angular/atomic-angular";

@Component({
selector: "sample-component",
imports: [FiltersBarComponent],
template: `
<filters-bar />
`,
})
export class SampleComponent {}
filters bar

Advanced Example with Customization​

sample.component.ts
import { FiltersBarComponent } from "@angular/atomic-angular";
@Component({
selector: "sample-component",
imports: [FiltersBarComponent],
template: `
<filters-bar
direction="vertical"
position="right"
[excludeFilters]="['Sources']"
[filtersCount]="9"
/>
`,
})
export class SampleComponent {}
filters bar advanced

API Reference​

Inputs​

NameTypeDescription
directionhorizontal | verticalDirection of the filter bar (default: horizontal).
positionPlacementPosition of the dropdown filters (default: bottom-start).
includeFiltersstring[]List of filter names that should only be displayed (default: []).
excludeFiltersstring[]List of filter names to exclude from the bar (default: []).
aggregationsAggregation[]List of filter names to include in the bar (default: undefined).
filtersCountnumberMaximum number of filters to display before overflow (default: 5).
showMoreFiltersButtonbooleanWhether to show the "More Filters" button (default: true).

filtersCount can be customized using the Angular Injection Token: FILTERS_BREAKPOINT.
This allows you to define how many filters should be displayed before the "More" button appears.

Methods​

MethodDescription
clearFilters()Removes all active filters from the filter bar. Use this to reset the filter state.
clearBasket()Empties the basket, removing all selected items.

Outputs​

EventDescription
onClearFiltersEmitted when all filters are cleared.
onClearBasketEmitted when the basket is cleared.

Schemas​

Component Interaction​

Store Interaction​

Notes​

  • The filters bar is highly modular and can be used independently or with other filter components.
  • All filter state is managed via stores (AggregationsStore, QueryParamsStore, etc.), ensuring consistency across the UI.