components / manager-table

manager-table.

admin table with inline rename, swatch recolor, archive, and confirmed delete. every mutation is a callback — bring your own state. rows can be locked (no rename/delete), and every handler may be async — a rejection surfaces inline under the row.

NameColorStatusActions
installation
bunx @justin06lee/chrome@latest add manager-table
props
nametypedefaultdescription
rows *ManagerRow[]-rows to render; the source of truth, owned by the caller. a row with locked: true (built-in/system rows) renders without rename/delete affordances.
palette(string | { value: string; name?: string })[]CATEGORY_PALETTEcolors offered by the recolor swatch picker — hex strings or { value, name } entries. a name shows in the swatch tooltip instead of the raw hex.
onRename(id: string, name: string) => void | Promise<void>-commit a renamed row. async handlers show the draft name optimistically; reject to roll it back and surface the error under the row.
onRecolor(id: string, color: string) => void | Promise<void>-commit a recolored row. while an async handler runs the row's actions are disabled; reject to surface the error under the row.
onArchive(id: string, archived: boolean) => void | Promise<void>-toggle a row's archived flag. while an async handler runs the row's actions are disabled; reject to surface the error under the row.
onDelete(id: string) => void | Promise<void>-delete a row (already confirmed). reject to block the delete — the row stays and the error surfaces under it. while it runs the row's actions are disabled.
classNamestring-