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.
| Name | Signature | Description |
|---|---|---|
type | readonly type: 'edit' | 'delete' | 'save' | 'cancel' | 'custom'; | |
labeloptional | readonly label?: string; | Visible text. Default: the localized command name. |
iconoptional | readonly icon?: ReactNode; | Icon content rendered before the label. |
titleoptional | readonly title?: string; |
|
onClickoptional | readonly onClick?: (ctx: {
readonly rowId: RowId;
readonly row: Row;
}) => void; |
|