Guide
Examples
Short recipes for the pieces that don't fit in "add a board in 3 steps," plus the runnable example app.
WIP limits with a visible warning
wipLimit is per column. Leave it nil for unlimited. With .warnOnly (the default), the column header switches to wipLimitWarningColor once over — the drop still succeeds:
Stage(id: UUID(), name: "In Progress", cards: currentCards, wipLimit: 3) KanbanBoard(columns: $columns, wipLimitBehavior: .warnOnly, /* ... */)
Switch to .preventDrop if the limit needs to actually hold — pointer, keyboard, and VoiceOver all get the same rejection.
Column collapse
isCollapsed lives on your own column type, so it persists however the rest of your model does — no separate UI-state store to wire up. The board toggles it directly when the header's chevron is tapped:
struct Stage: KanbanColumn { // ... var isCollapsed: Bool = false // toggled by the board on tap, persisted by you }
Card content beyond a plain title
Because the package never owns content, a card with an avatar, a priority chip, and a due date is just a normal SwiftUI view passed to cardContent:
KanbanBoard( columns: $columns, cardContent: { task in VStack(alignment: .leading, spacing: 6) { Text(task.title).font(.subheadline.weight(.medium)) HStack { PriorityChip(priority: task.priority) // your own view Spacer() AvatarBadge(initials: task.assigneeInitials) } } }, columnHeader: { stage in Text(stage.name).font(.headline) } )
Multiple themes, switched at runtime
See Theming for the full token reference — this is the same pattern the example app uses for its Standard / High Contrast picker:
enum AppTheme: String, CaseIterable { case standard, highContrast var kanbanTheme: KanbanTheme { switch self { case .standard: .default case .highContrast: KanbanTheme(/* high-contrast tokens */) } } }
Switching KanbanTheme restyles chrome only. If your cardContent uses fixed colors, pair them with the active theme too — see the callout in Theming for exactly this trap.
The runnable example app
The full picture — a realistic task-board model, custom card content, a WIP limit set to .preventDrop, column collapse, theme switching, and per-view SwiftUI previews — lives in Example/ in the repo. Two checked-in Xcode schemes, AdvancedKanbanExample (macOS) and AdvancedKanbanExample (iOS), give a predictable native window on either platform the moment you open the project.