# tableberg/1.1.5/src/components/ElementDeleteButton.tsx

Tableberg – Simple Gutenberg Table Block, version 1.1.5. 28 lines.

- Page: https://pluginprobe.com/plugins/tableberg/1.1.5/code/src/components/ElementDeleteButton.tsx
- Raw: https://pluginprobe.com/plugins/tableberg/1.1.5/raw/src/components/ElementDeleteButton.tsx
- Modified: 2026-09-16T03:30:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/tableberg/1.1.5/code/src/components/ElementDeleteButton.tsx#L10-L20`.

```tsx
import { ToolbarButton } from "@wordpress/components";
import { __ } from "@wordpress/i18n";
import { trash } from "@wordpress/icons";
import { CellKey } from "../attributes";
import { useTableStore } from "../store";

export function ElementDeleteButton({
    cellCoords,
    elementIndex,
}: {
    cellCoords: CellKey;
    elementIndex: number;
}) {
    const removeElementFromCell = useTableStore(
        state => state.removeElementFromCell
    );

    return (
        <ToolbarButton
            icon={trash}
            label={__("Delete element", "tableberg")}
            title={__("Delete element", "tableberg")}
            isDestructive
            onClick={() => removeElementFromCell(cellCoords, elementIndex)}
        />
    );
}

```
