move-swimlane
PRO
The functionality is available in PRO Edition only
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;
};
| Field | Type | Description |
|---|---|---|
id | string | number | The swimlane to move |
before | string | 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)"
/>
Related
- Swimlanes guide - lane setup and behavior
- Group Manager - reorder lanes from a ready-made panel
- move-column - the same action for columns
- swimlanes - lane definitions in board order