Spreadsheet grid — Table block
Protable-spreadsheet-grid · for app pages
Spreadsheet grid
Edit a dense table with a frozen first column and row selection, then save the edits in one go.
Documentation
Installation
One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).
pnpm dlx shadcn-vue@latest add @trame/table-spreadsheet-gridUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import TableSpreadsheetGrid from '@/components/trame/blocks/table/table-spreadsheet-grid.vue'
const props = {
title: "Plan the restocks",
description: "Edit the quantities and select the rows to compare.",
columns: [
{
key: "article",
label: "Item",
type: "text"
},
{
key: "collection",
label: "Collection",
type: "text"
}
],
rows: [
{
article: "Rain jacket",
collection: "Outdoors",
stock: 12,
quantity: 24,
date: "2026-11-04"
},
{
article: "Wool beanie",
collection: "Outdoors",
stock: 8,
quantity: 16,
date: "2026-11-04"
}
],
save: "restock.save"
}
</script>
<template>
<TableSpreadsheetGrid v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe section’s heading |
| description | string | Wordsa few words saying more, under the heading |
| columns* | Column[] | the columns shown, in order |
| rows* | Record<string, unknown>[] | Datathe rows shown, in order |
| save | string | Actionsaves the edits: shown once a cell changed or a row was added; through the host it receives `{ data: { rows } }`, every row as edited; posted natively, `rows` holds them as JSON |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Column columns[] · 3 props
| Prop | Type | Description |
|---|---|---|
| key* | string | Designthe row key to read |
| label* | string | Wordsthe column’s name, as shown |
| type* | 'text' | 'number' | 'date' | what kind of column it is: text, number, date |
Options options · 1 props
| Prop | Type | Description |
|---|---|---|
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a band of the page that redefines the theme surfaces inside it |
What it asks your app for
The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your word for an interface key, or undefined to keep the block’s own |
The words it says itself, in English and French; label(key) replaces any of them:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too many attempts, try again in a moment. | Trop de tentatives, réessayez dans un moment. |
Features
- Every word in the server HTML
- Same markup in Vue and React
- Theme tokens only: every theme, light and dark
- Shows what you give it, invents nothing
- No motion; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
record.save - Reads
rowsfrom your app
A table section, for app pages.
More table blocks
- Record rows list: comparable records, each with a picture or initials, two lines and a badge: members, channels.
- Resource list cards: records read by their picture or a few fields (products, team members): a grid of cards with the same search, filters, sort and selection.
- Resource list compact: long lists worked through quickly: dense rows, a density switch, a sticky header and identity column.
- Resource list: records a team searches, sorts and acts on, one comfortable row each: orders, invoices, customers.
- Resource totals: records whose amounts matter together: a footer with the selection count and the list’s own totals.
- Stage rows track cards: fewer records each needing a next step: one card per record with a status sentence, the labelled track full width and the action beside it, filters in a rail.
- Stage rows track: many records followed at a glance (shipments, sales orders): a table whose progress column is a row of joined dots, an exception named in words.
- Stock levels filter rail: a long inventory narrowed often: filters in a left rail beside dense rows (a "Filters" sheet on a phone).