View as Markdown

API reference: @salmonui/data-grid

DataGridCommandIteminterface

import type { DataGridCommandItem } from '@salmonui/data-grid';
interface DataGridCommandItem<Row = unknown> {
    readonly type: 'edit' | 'delete' | 'save' | 'cancel' | 'custom';
    readonly label?: string;
    readonly icon?: ReactNode;
    readonly title?: string;
    readonly onClick?: (ctx: {
        readonly rowId: RowId;
        readonly row: Row;
    }) => void;
}

One button of a command column.

DataGridCommandItem members (5)
NameSignatureDescription
typereadonly type: 'edit' | 'delete' | 'save' | 'cancel' | 'custom';
labeloptionalreadonly label?: string;

Visible text. Default: the localized command name.

iconoptionalreadonly icon?: ReactNode;

Icon content rendered before the label.

titleoptionalreadonly title?: string;

title tooltip (also the accessible name when label is empty).

onClickoptionalreadonly onClick?: (ctx: { readonly rowId: RowId; readonly row: Row; }) => void;

custom commands: called on click (after onCommandClick).