Skip to main content

update-swimlane

PRO

The functionality is available in PRO Edition only

Patches an existing swimlane with the provided partial. The store merges the new fields into the lane config by id. If no lane matches the given id, the action does nothing.

The built-in lane collapse toggle and lane renames both go through this action. These changes don't touch card undo history.

Usage​

type UpdateSwimlanePayload = {
id: SwimlaneID;
swimlane: Partial<SwimlaneConfig>;
};
FieldTypeDescription
idstring | numberThe swimlane to update
swimlanePartial<SwimlaneConfig>Fields to merge into the lane

The action can patch any SwimlaneConfig field: label, collapsed, css, and metadata. The lane id doesn't change. The action ignores any id inside swimlane and keeps the id from the payload.

Trigger​

api.exec("update-swimlane", {
id: "platform",
swimlane: { label: "Platform team", collapsed: false },
});

Observe​

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

Intercept​

api.intercept("update-swimlane", ev => {
// keep a specific lane expanded
if (ev.id === "product" && ev.swimlane.collapsed) return false;
});

Component handler​

The action is forwarded to the onupdateswimlane prop.

<Kanban
:cards="cards"
:columns="columns"
:swimlanes="swimlanes"
:onupdateswimlane="(ev) => console.log('Swimlane changed:', ev.id)"
/>