Atomic Angular — Doc interne

Filters bar

A toolbar listing the facets a user can filter on — one popover button per aggregation, with overflow handled by a "More" button.

<filters-bar> renders one filter button per authorized aggregation, in a keyboard- navigable toolbar, and folds whatever does not fit into a "More" button. It shows what a user can filter on — contrast with Applied filters, which shows what the query is currently filtered by.

Concept — authorized filters

An aggregation becomes a filter button only if the app's JSON configuration says so (position: "left" | "both", never "left" only in the bar) and the admin has not marked it hidden. Resolving that list is AggregationsService.getAuthorizedFilters — the bar, <more-button> and <aside-filters> all call through it, so the three surfaces never disagree on which facets exist.

Minimal example

A toolbar over the current query's aggregations
sample.component.ts
import { Component } from "@angular/core";
import { FiltersBarComponent } from "@sinequa/atomic-angular";

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

Each button opens its aggregation in a popover — see Filter button. Once more filters are authorized than filtersCount allows, the remaining ones move into the "More" button rather than overflowing the toolbar.

How it works

fits doesn't fit FiltersBarComponent getAuthorizedFilters() OverflowManagerDirective measures available width FilterButton ×N MoreButton (overflow)

The bar is an @angular/aria Toolbar: arrow keys rove between buttons, and the overflow manager recounts how many fit whenever the container resizes or the applied filters/basket change — a button hidden by overflow emits no resize notification of its own when its natural width changes, so the recount is driven by the store instead.

Recipes

Limit and reorder the visible filters

Only two filters, before overflowing to More
sample.component.ts
import { Component } from "@angular/core";
import { FiltersBarComponent } from "@sinequa/atomic-angular";

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

filtersCount can also be set application-wide through the FILTERS_BREAKPOINT injection token, rather than repeating it on every <filters-bar>:

app.config.ts
import { FILTERS_BREAKPOINT } from "@sinequa/atomic-angular";

providers: [{ provide: FILTERS_BREAKPOINT, useValue: 3 }];

A vertical bar, for a sidebar layout

Filters stacked in a narrow column
sample.component.ts
import { Component } from "@angular/core";
import { FiltersBarComponent } from "@sinequa/atomic-angular";

@Component({
  selector: "sample-component",
  imports: [FiltersBarComponent],
  template: ` <filters-bar direction="vertical" position="right" class="w-56" /> `,
})
export class SampleComponent {}

Options

Prop

Type

Pitfalls

What's next

On this page