Officina UI
Components

SavedViews

Save, switch, share, and persist named filter presets ("views") for a filtered table.

SavedViews lets users capture the current filter state as a named view, switch between saved presets, and share them by URL. In its primary mode it reads the live filter state from FiltersProvider and serializes it under urlKey, persisting views to localStorage by default (override with a storage adapter). Render it inside a filter bar so people can return to a configuration in one click.

Example

Preview
import { FiltersProvider, SavedViews } from '@officina/ui';

<FiltersProvider value={filters}>
  <SavedViews urlKey="status" onShare={(url) => navigator.clipboard.writeText(url)} />
</FiltersProvider>;

API

PropTypeDefaultDescription
currentFilters*unknown—Current filter state captured when saving a new view.
onChange*(view: LegacySavedView | null) => void—Called with the selected view (or null when cleared).
storageKey*string—Storage key used to persist views (legacy controlled mode).
urlKey*string—Query-string key the active view serializes filters into.
value*string | null—Id of the active saved view, or null (controlled).
onShare(url: string) => void—Called with a shareable URL when the user shares a view.
placeholderstring—Placeholder for the view selector.
saveLabelstring—Label for the save-view action.
shareLabelstring—Label for the share-view action.
storageSavedViewsStorage—Storage adapter for persisting saved views. Defaults to localStorage.
updateLabelstring—Label for the update-current-view action.

On this page