Installation
Theme
Mode

Navigation

Saved views

A tab bar of named, saved configurations of a list — “My work”, “This sprint”, “Blocked” — each remembering its own grouping, sort and filters. Switch in a click, rename inline, duplicate, add and delete, and save changes back.

$npx shadcn@latest add @orbit/saved-views

Overview

Switch views to see each one’s grouping, sort and filter chips; double-click a tab to rename, open the active view’s caret for options, or + to add a view.

Live — the bar sits above a List, Table, Kanban or Calendar
All tasks
GroupStatusSortManualFiltersNone
Double-click a tab to rename

Save or reset

A view stores its configuration, so edits are deliberate: when the consumer marks the view dirty, a warning dot with Save / Reset appears at the bar’s right edge instead of silently persisting every tweak.

My work
GroupStatusSortPriorityFilters1 active
Tweak the view to see Save / Reset

Without the config row

showConfig={false} drops the active-view summary when the surface below already communicates the configuration.

Props

PropTypeDefaultDescription
views / defaultViewsSavedView[]Controlled / uncontrolled view list. SavedView = { id, name, icon?, count?, group?, sort?, filters? }.
onViewsChange(views: SavedView[]) => voidFires on add, rename, duplicate, delete and save.
activeId / defaultActiveIdstringControlled / uncontrolled active view id (defaults to the first view).
onActiveChange(id, view) => voidSelection changed — via click, keyboard, add, duplicate or delete.
dirtybooleanfalseShows the warning dot with Save / Reset actions.
onSave(view) => voidSave clicked. Uncontrolled default also folds the tweak into the view’s filter count.
onReset(view) => voidReset clicked — discard pending changes.
onSetDefault(view) => void“Set as default” chosen from the view options menu.
onAddView() => voidReplaces the built-in “+ adds a New view and starts rename” behavior.
showConfigbooleantrueConfig row with the active name and Group / Sort / Filters chips.
hintstring"Double-click a tab to rename"Muted helper text at the right edge of the config row.
…restHTMLAttributesForwarded to the root <div>, including ref.

Usage

Do

Seed a few useful defaults

Ship views people actually want — “My work”, “This sprint” — so the value is obvious before they make their own.

Don’t

Auto-save every tweak

Silent saves make views drift unpredictably. Show a save action so a change is a decision, not an accident.

Do

Show the active configuration

Surface the grouping, sort and filter count of the current view so its state is never a mystery.

Don’t

Let tabs sprawl endlessly

Past a handful, scroll or group them. A tab bar that overflows the screen stops being a quick switcher. (The bar scrolls horizontally when it must.)

Keyboard & accessibility

The bar is a WAI-ARIA tablist: tabs carry role=tab and aria-selected, the options menu is a real menu with roving focus, and the rename field commits on Enter or blur.

All tasks
GroupStatusSortManualFiltersNone
Tab into the bar, then use arrow keys
← →Move between views (selects as it moves)
Home / EndFirst / last view
Enter / SpaceSelect the focused view
F2Rename the focused view (or double-click)
EnterCommit rename · blur also commits
EscCancel rename / close the options menu