# Saved Views Table

> The flagship SaaS list: saved view tabs that remember their filters (edits show Save and Reset), faceted filters whose counts follow the search and other filters, a / search that highlights matches, sorting, column picker, density and CSV export. Wide tables scroll sideways under pinned columns with edge shadows, and shift-click selects a run for bulk actions.

- Slug: `saved-views-table`
- Category: [Tables](https://www.assembli.design/category/tables.md)
- Type: component
- Tags: table, data-grid, filters, search, saved-views, horizontal-scroll, pinned-columns, bulk-actions, pagination, export
- npm dependencies: @base-ui/react, motion, lucide-react
- shadcn/ui dependencies: none
- Live preview: https://www.assembli.design/preview/saved-views-table
- Page: https://www.assembli.design/components/saved-views-table

![Saved Views Table preview](https://www.assembli.design/thumbnails/saved-views-table-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `rows` (required) | `T[]` |  |  |
| `columns` (required) | `SavedViewsColumn<T>[]` |  |  |
| `filters` | `SavedViewsFilter<T>[]` | `[]` |  |
| `views` | `SavedView[]` | `[{ id: "all", label: "All" }]` | Tabs across the top. Each one is a set of filters; the first is the default. |
| `rowActions` | `SavedViewsRowAction<T>[]` | `[]` |  |
| `bulkActions` | `SavedViewsBulkAction<T>[]` | `[]` |  |
| `title` | `React.ReactNode` |  |  |
| `actions` | `React.ReactNode` |  | Buttons beside the title (e.g. "Add customer"). |
| `noun` | `{ one: string; many: string }` | `{ one: "row", many: "rows" }` |  |
| `rowLabel` | `(row: T) => string` | `(row) => row.id` | Names a row for its checkbox: "Select Acme". |
| `pageSizes` | `number[]` | `[10, 25, 50]` |  |
| `maxHeight` | `number` | `576` | Height of the scrolling body in px. |
| `onViewsChange` | `(views: SavedView[]) => void` |  | Called with the views after "Save view". |

## Install

One-time setup (needs a subscription):

1. Add the registry to the project's `components.json`: `{"@assembli":{"url":"https://www.assembli.design/r/{name}.json","headers":{"Authorization":"Bearer ${ASSEMBLI_API_KEY}"}}}` (merge into `"registries"`).
2. Put an API key from https://www.assembli.design/account in `.env.local` as `ASSEMBLI_API_KEY=asm_…`.

Then install with the shadcn CLI (writes `components/saved-views-table/saved-views-table.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/saved-views-table
```

Registry item JSON: https://www.assembli.design/r/saved-views-table.json (send `Authorization: Bearer <api key>`)

## Code

> Component source needs an Assembli subscription ($12/month or $96/year) and an API key sent as `Authorization: Bearer <key>`. To get one without copying anything, POST https://www.assembli.design/api/agent/login (or call the MCP tool connect_account), show the user the link it returns, and poll https://www.assembli.design/api/agent/token for the key. Or subscribe at https://www.assembli.design/pricing and create a key at https://www.assembli.design/account.
