GroupManager
The functionality is available in PRO Edition only
PROPanel for managing the board's columns and swimlanes. Users can rename, reorder, add, and delete groups. The panel dispatches the structural actions (add-column, move-column, delete-column, and their swimlane counterparts) and uses update-column / update-swimlane for renames. It never moves or deletes cards.
import { GroupManager } from "@svar-ui/react-kanban";
Usage
<Kanban ref={setApi} cards={cards} columns={columns} swimlanes={swimlanes} />
{open && api && (
<GroupManager
api={api}
placement="sidebar"
swimlanes
onClose={() => setOpen(false)}
/>
)}
Props
Props type: GroupManagerProps.
| Prop | Type | Default | Description |
|---|---|---|---|
api | KanbanInstanceApi | null | null | Kanban instance to manage. With null, the panel renders empty and inactive |
placement | "inline" | "sidebar" | "modal" | "popup" | "inline" | Where the panel renders |
parent | HTMLElement | - | Anchor element for the "popup" placement |
swimlanes | boolean | false | Shows tabs to switch between the column list and the swimlane list |
readonly | boolean | false | Hides add/delete controls and disables rename and reorder |
onClose | () => void | - | Called by the header close button and on container cancel |
Placement values:
"inline"- (default) renders in the normal document flow"sidebar"- slide-in panel inside the nearest relatively positioned container"modal"- centered dialog"popup"- popup attached toparent
The host controls visibility with conditional rendering ({open && ...}). With swimlanes, the swimlane tab stays available even when the board has no lanes.
Interactions
- Click a label or press Enter on a focused row to rename. Enter or blur commits a non-empty changed label; Escape or whitespace-only input cancels.
- Drag the row handle or press Alt+ArrowUp / Alt+ArrowDown to reorder.
- Add creates the group immediately and focuses its label input.
- Delete removes the group configuration immediately. Cards keep their column/swimlane values.
- Each row shows a card count with active filters applied. Cards that point to a missing group appear in a notice. Its button restores the missing ID with a label only; other config isn't restored.
Structural changes reset undo/redo history. On a board where columns or swimlanes are inferred from cards, pass explicit arrays to keep groups that have no cards. With RestDataProvider attached through setNext, the provider sends every change to the column and swimlane endpoints.
Example
import { useState, useRef } from "react";
import { Kanban, GroupManager } from "@svar-ui/react-kanban";
const columns = [
{ id: "todo", label: "To do" },
{ id: "doing", label: "In progress" },
{ id: "done", label: "Done" },
];
const swimlanes = [
{ id: "product", label: "Product" },
{ id: "platform", label: "Platform" },
];
const cards = [
{ id: 1, label: "Spec", column: "todo", swimlane: "product" },
{ id: 2, label: "API", column: "doing", swimlane: "platform" },
];
function App() {
const [api, setApi] = useState();
const [open, setOpen] = useState(false);
const anchorRef = useRef(null);
return (
<>
<button ref={anchorRef} onClick={() => setOpen(!open)}>
Manage groups
</button>
<Kanban ref={setApi} cards={cards} columns={columns} swimlanes={swimlanes} />
{open && api && (
<GroupManager
api={api}
placement="popup"
parent={anchorRef.current}
swimlanes
onClose={() => setOpen(false)}
/>
)}
</>
);
}
export default App;
Related
- Columns guide - column setup, layout, and runtime updates
- add-column, move-column, delete-column, update-column - column actions the panel dispatches
- add-swimlane, move-swimlane, delete-swimlane, update-swimlane - swimlane actions the panel dispatches