4.2.0
Patterns

FilterBar

The head every list surface wears, so two products never invent two different ways to save a view.

Default

Saved views, a query box and a filter count — the standard head of a list surface.

Usage

import { FilterBar } from '@oceanic-hub/brand-system'

views are the saved-view chips; filterCount is the number of active filters, shown on the filter affordance so a person can see why a list looks short. The component owns no filtering logic — it reports intent and the host applies it: the search box, the Filter button and the Group-by button are all callback props, and the filter/group panels they open belong to the caller entirely.

Omit views and the whole saved-view section goes — the divider and the pill row — rather than rendering an empty one. A list with no saved views should not carry a seam for a feature it does not have.

Oceanic-only: there is no shadcn original for a combined search-and-filter head. A reader coming from shadcn would reach for Input (the query box), a Select or DropdownMenu (Filter and Group by) and Badge (the active-filter count) and assemble them by hand each time. FilterBar settles that head once, and since @OCE-1875 it settles it by composing those components rather than redrawing them: the query box is an InputGroup over Input, the two affordances are Buttons, the active-filter count is a Badge and the divider is a Separator. So it inherits the field ground, the 6px radius, the 44px control height, the brand focus ring and the disabled treatment — and a future change to Input reaches it without anybody editing this file.

What it does NOT compose is Select, deliberately. A select owns its options; this owns none, by the same argument that makes onFilterClick a callback. The affordances report intent and the panels they open belong to the caller, so they are buttons.

It was built from a raw input and raw buttons until then — in the layer whose job is making every product inherit the look — and the seam showed worst on the data-table archetype, where it sits directly above a Table: 16px corners over a 6px grid, 38px controls against a scale of 32/36/40, a field on the page's own ground where every other field in the package sits one step below it, and, on the first control a keyboard reaches, outline: none with nothing put back.

Without saved views

views is optional, and omitting it drops the divider and the pill row entirely rather than rendering an empty section — the right shape for a list that has no saved views at all.

Filter count badge

The badge on Filter only exists once filterCount is above zero — a bar with nothing active shows a plain button, not a badge reading "0".

API Reference

See the FilterBar API page for every prop of every part, with types, defaults and the contract that pins them.

On this page