Skip to main content

move-swimlane

The functionality is available in PRO Edition only

PRO

Moves a swimlane to a new position in the board's lane order. The action works the same way as move-column. It changes the swimlane configuration only. Cards keep their lane membership.

A successful move resets undo/redo history. The action is a no-op and keeps history when the id matches no swimlane, the lane is moved before itself, or the lane would stay at its current index.

Usage​

type MoveSwimlanePayload = {
id: SwimlaneID;
before?: SwimlaneID | null;
};
FieldTypeDescription
idstring | numberThe swimlane to move
beforestring | number | null (optional)Place the swimlane before this lane. null, an omitted value, or an id that matches no lane moves it to the end.

On a board with inferred swimlanes (no swimlanes prop), the new order doesn't persist. The board rebuilds the lane list on the next card or accessor change. Pass an explicit swimlanes array to keep the order.

Trigger​

Move a lane to the top:

api.exec("move-swimlane", { id: "platform", before: "product" });

Move a lane to the end:

api.exec("move-swimlane", { id: "product", before: null });

Observe​

api.on("move-swimlane", ev => {
console.log("Swimlane moved:", ev.id, "before", ev.before);
});

Intercept​

api.intercept("move-swimlane", ev => {
// keep the "urgent" lane pinned at the top
if (ev.id === "urgent") return false;
});

Component handler​

The onMoveSwimlane prop receives the action.

<Kanban
cards={cards}
columns={columns}
swimlanes={swimlanes}
onMoveSwimlane={(ev) => console.log("Swimlane moved:", ev.id)}
/>