Skip to content
CdsTable

Drag and drop

Drag and drop for rows and columns: the table shows grip icons and reports the move with events, while your code changes the order of the data.

Storybook GitLab Figma
Test coverage: 0% — low coverage
API in specs
0 / 72 props, events, slots and exposed members with a test
Test cases
13 unit · 0 browser
Code coverage
15.2% lines · 7.4% branches measured in v4.0.0-alpha.13
A11y (axe)
50 recommendations in 39 stories measured in v4.0.0-alpha.11

Dragging rows ​

The row-draggable prop shows a grip icon to the left of the row. The move is reported by the row-reorder event — change the order in data yourself. A row can only be dropped between neighboring rows.

Dragging nested rows ​

In a tree, a row is only reordered among the siblings of its own parent: it cannot be dropped onto another level — the cursor shows "not allowed" and no event arrives.

Dragging columns ​

The column-draggable prop adds a grip icon to the header. The column-reorder event reports the new order — update the columns array.

Dragging columns with groups ​

A leaf column is reordered inside its own group, while a group header is dragged as a whole among neighboring groups.