# Dataset Preview block

> Dataset preview sheet with masked sample rows, a schema view and upstream column drift

Sample one connected table as rows or schema, with a Mask PII switch, an audit warning on unmask, copy query, resample and Accept for new columns. ReUI Frame, Alert, Badge; shadcn Sheet, Table, ToggleGroup, Select. Data catalog, table explorer.

- Type: Pro block
- Category: [Sheet](https://web.dev.reui.io/blocks/application/sheet.md)
- Page: https://web.dev.reui.io/blocks/application/sheet/sheet-24
- Docs (Base UI): https://ui.shadcn.com/docs/components/base/sheet.md
- Docs (Radix UI): https://ui.shadcn.com/docs/components/radix/sheet.md
- MCP: `get_block("sheet-24")`
- Built with: Alert, Badge, Button, Empty, Frame, Icon Tile, Label, Select, Sheet, Skeleton, Spinner, Switch, Table, Toggle Group, Tooltip
- Installs with a ReUI Pro or Ultimate license; setup: https://web.dev.reui.io/docs/license-setup

## Best for

The sample preview alone, with no sync controls or tabs: a dataset Select, a Rows or Schema toggle and PII columns masked by default

## Agent notes

- The `sampleRows` helper generates every row from column specs, and New sample only bumps `draw` after `RESAMPLE_MS`; fetch real rows
- The `maskSample` call masks PII in the browser on rows already loaded, and the unmask warning is text only; mask server side and log reads
- The `CONNECTIONS` seed holds the sample dataset, and `setLinked` and `acceptDrift` only edit state with Undo toasts; persist both

## When not to use

- Sync controls, credentials and dataset links managed beside the sample: use [Data Connection](https://web.dev.reui.io/blocks/application/sheet/sheet-22.md) (`get_block("sheet-22")`)
- Paging, sorting and filtering through every row of a table, not a sample: use [Data Grid](https://web.dev.reui.io/components/data-grid.md) (`get_component("data-grid")`)

## Third-party libraries

- Sonner v2: [API reference](https://sonner.emilkowal.ski/toast), [docs](https://sonner.emilkowal.ski/getting-started)

## Install

```bash
npx shadcn@latest add @reui/sheet-24
```

## About Sheet blocks

### When to use

- Record detail opened over a list or table: a ticket, metric, cron job, audit event, deploy, SLO or data source
- Create and edit forms in a side panel for a project, cron job, firewall rule, SLO or data connection
- Utility panels for help guides, keyboard shortcuts, an AI assistant, comments, notifications or view settings

### When not to use

- A bare side panel with your own header, body and footer, nothing prebuilt: use [Sheet](https://web.dev.reui.io/components/sheet.md) (`get_component("sheet")`)
- A persistent sidebar or navigation layout that stays around every page: use the [App Shell blocks](https://web.dev.reui.io/blocks/application/app-shell.md)
- An assistant conversation that fills the whole page rather than a side panel: use the [AI Chat blocks](https://web.dev.reui.io/blocks/ai-agents/ai-chat.md)

### Agent notes

- Each root renders a demo `SheetTrigger` button and opens on mount via `defaultOpen` or a `useState` seeded true; start it closed in your app
- Each `SheetContent` className floats it inset with `inset-y-4`, `right-4` and `rounded-xl` and sets its own width; resize it there, not in the primitive
- Each page.tsx only centers the trigger in a `min-h-svh` main with an `sr-only` h1; render the root component alone inside your page

Every ReUI item has a twin like this one; the index is https://web.dev.reui.io/llms.txt. Agents with the ReUI MCP (https://web.dev.reui.io/docs/mcp) get the same guidance from the getters named above.
