Skip to main content

action

inline Edit / Save / Copy / Delete buttons.

The action cell rendered in a Bst-Table grid

Example source
import React from 'react'
import { BstTableMui } from '@bloomskill/table-mui'
import type { BstTableColumn } from '@bloomskill/table-engine'
import '@bloomskill/table-engine/styles.css'
type Row = { id: string; name: string; team: string; role: string; score: number }
const seed: Row[] = [
{ id: '1', name: 'Ada Lovelace', team: 'Platform', role: 'Engineer', score: 92 },
{ id: '2', name: 'Alan Turing', team: 'Research', role: 'Scientist', score: 88 },
{ id: '3', name: 'Grace Hopper', team: 'Platform', role: 'Engineer', score: 95 },
{ id: '4', name: 'Katherine J.', team: 'Research', role: 'Analyst', score: 90 },
{ id: '5', name: 'Edsger Dijkstra', team: 'Platform', role: 'Architect', score: 84 },
]
const columns: BstTableColumn<Row>[] = [
{ id: 'name', accessorKey: 'name', header: 'Name' },
{ id: 'team', accessorKey: 'team', header: 'Team' },
{ id: 'role', accessorKey: 'role', header: 'Role' },
{ id: 'score', accessorKey: 'score', header: 'Score', sortFn: 'basic' },
]
const withActionCol: BstTableColumn<Row>[] = [...columns, { id: 'actions', accessorKey: 'id', header: 'Actions', meta: { type: 'action' } }]
export default function App() {
const [rows, setRows] = React.useState(seed)
return (
<BstTableMui data={rows} columns={withActionCol} getRowId={(r) => r.id}
enableEditing enableRowActions onDataChange={setRows} pagination={false} />
)
}
Loading live example…

Guide

When to use it

A row's controls — edit, save, duplicate, delete — as inline buttons in a dedicated column.

How it works

Renders a button for each action you enable via meta.actions (e.g. { edit: true, delete: true, duplicate: true }); each drives the row's edit session. It has no cell value of its own. Pin it last so it stays put while the other columns scroll.

Gotchas

  • Needs enableRowActions (and enableEditing for edit/save) — the buttons act on the edit session.
  • For a compact, single-button alternative, use actionMenu.

At a glance

Rendersinline Edit / Save / Copy / Delete buttons
Value shape
Editable
Key cellMetavia meta.actions

Use it

const columns: BstTableColumn<Row>[] = [
{ id: 'x', accessorKey: 'x', header: 'X', meta: { type: 'action', /* cellMeta below */ } },
]