Skip to main content

Themes

Kanban draws its colors, shadows, and typography from CSS custom properties injected by a theme wrapper component. The widget never hardcodes visual values - it reads var(--wx-kanban-*) tokens (and a handful of shared --wx-* tokens) from the nearest ancestor that sets them. To restyle the board, override those variables on a wrapper element; to restyle individual cards or columns at runtime, use the cardCss and columnCss callback props.

Default themes​

Four themes ship with the package: Willow (light), WillowDark (dark), and the export themes Print and PrintBW. The export themes match the "print" and "bw" export skins. See Appearance skins for how the export service applies them. For the on-screen board, mount Willow or WillowDark at your app root so every SVAR component beneath it picks up the same visual baseline:

import { Kanban, Willow } from "@svar-ui/react-kanban";

function App() {
return (
<Willow>
<Kanban cards={cards} columns={columns} />
</Willow>
);
}

Kanban board in the default Willow light theme

For dark mode, swap Willow for WillowDark:

import { Kanban, WillowDark } from "@svar-ui/react-kanban";

function App() {
return (
<WillowDark>
<Kanban cards={cards} columns={columns} />
</WillowDark>
);
}

Kanban board in WillowDark theme

One theme wrapper covers the board, editor, toolbar, and context menu - you don't need to wrap each sub-component separately.

Switching theme at runtime​

Both theme wrappers are regular React components, so you can switch between them with a conditional:

import { useState } from "react";
import { Kanban, Willow, WillowDark } from "@svar-ui/react-kanban";

function App() {
const [dark, setDark] = useState(false);

return (
<>
{dark ? (
<WillowDark>
<Kanban cards={cards} columns={columns} />
</WillowDark>
) : (
<Willow>
<Kanban cards={cards} columns={columns} />
</Willow>
)}
<button onClick={() => setDark(d => !d)}>Toggle theme</button>
</>
);
}

CSS variables and overrides​

Kanban-specific variables​

These variables control the board's own surfaces. They all live under the --wx-kanban-* namespace.

VariableControls
--wx-kanban-bgBoard background
--wx-kanban-lane-bgSwimlane background
--wx-kanban-column-bgColumn background and sticky header
--wx-kanban-card-bgCard background
--wx-kanban-card-shadowCard resting shadow
--wx-kanban-card-shadow-hoverCard hover shadow
--wx-kanban-card-shadow-dragDrag ghost shadow
--wx-kanban-border-colorColumn header divider and drop placeholder border
--wx-kanban-drop-placeholder-bgDrop-target highlight tint
--wx-kanban-tag-bgTag chip, default priority chip, and column summary tag background
--wx-kanban-avatar-bgAvatar fallback background
--wx-kanban-progress-bgProgress bar track
--wx-kanban-progress-fillProgress bar fill
--wx-kanban-priority-low-bgLow-priority chip background
--wx-kanban-priority-low-colorLow-priority chip text
--wx-kanban-priority-medium-bgMedium-priority chip background
--wx-kanban-priority-medium-colorMedium-priority chip text
--wx-kanban-priority-high-bgHigh-priority chip background
--wx-kanban-priority-high-colorHigh-priority chip text
--wx-kanban-scroll-heightInternal: tracks the scroll container height for collapsed columns

The widget also reads several shared SVAR variables directly - override these on the theme wrapper to tune the board alongside other SVAR widgets:

VariableControls
--wx-border-radiusCard corners, drop placeholder corners, priority chip rounding
--wx-radius-majorColumn corner radius
--wx-icon-border-radiusHover-state rounding on column buttons and the card menu button
--wx-color-primaryFocus ring on cards and column buttons
--wx-color-fontPrimary text (card titles, menu hover)
--wx-color-font-altMuted text (counts, deadlines, descriptions, progress labels)
--wx-color-font-disabledDisabled text
--wx-backgroundBase background (used by card background in both themes)
--wx-background-altAlternate background
--wx-background-hoverHover background on column buttons and card menu button
--wx-font-size-smSmall text size (counts, buttons)
--wx-line-height-smLine height of column summary tags
--wx-font-weightBase font weight
--wx-font-weight-mdMedium font weight (column titles, labels)
--wx-avatar-sizeAvatar dimensions
--wx-avatar-font-sizeAvatar fallback text size

Willow doesn't set --wx-color-font-alt and keeps the core default. Only WillowDark overrides it, along with --wx-color-font.

The themes don't set --wx-card-gap (default 8px). This variable sets the gap between cards and around the card list slots. The virtualizer also reads it to compute card offsets.

Overriding variables​

Wrap the board in a container element and set the variables there. This keeps the overrides scoped, so they don't leak into other parts of your app:

import "./my-board.css";

function App() {
return (
<div className="my-board">
<Willow>
<Kanban cards={cards} columns={columns} />
</Willow>
</div>
);
}
/* my-board.css */
.my-board {
--wx-kanban-card-bg: #fffff0;
--wx-kanban-column-bg: #f0f4f8;
--wx-kanban-card-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
--wx-kanban-progress-fill: #10b981;
}

Board state classes​

The .wx-board element carries classes that describe the current layout. Use them to scope overrides to one layout mode:

ClassApplied when
wx-scroll-boardThe whole board scrolls: render.columnScroll is false, swimlanes, or stack layout
wx-layout-flexrender.fixedColumnWidth is false (board layout)
wx-layout-stackrender.layout is "stack"
wx-lanesSwimlanes are shown in board layout
.wx-board.wx-lanes {
--wx-kanban-lane-bg: #f5f7fb;
}

Per-card and per-column CSS​

For styling that depends on runtime data - a card's priority, whether a column is over a custom WIP limit, progress state - use the cardCss and columnCss callback props. Each callback returns a CSS class name string that the renderer appends to the element's class list.

Card styling​

cardCss receives the card object and its parent column. Return one or more class names:

import "./board.css";
import { Kanban, Willow } from "@svar-ui/react-kanban";

const cardCss = (card, column) => {
const cls = card.priority === 3 ? "card-high" : "";
const done = (card.progress ?? 0) >= 1 ? "card-complete" : "";
return `${cls} ${done}`.trim();
};

function App() {
return (
<Willow>
<div className="board-wrapper">
<Kanban cards={cards} columns={columns} cardCss={cardCss} />
</div>
</Willow>
);
}
/* board.css */
.board-wrapper .wx-card.card-high {
border-top: 3px solid #ef4444;
}
.board-wrapper .wx-card.card-complete {
opacity: 0.6;
background: #f5f5f5;
}

cardCss doesn't replace a card's static css property - the renderer combines both, so you can set a permanent class on the card data and add dynamic classes at render time. The drag ghost shows only card.css, without the classes from cardCss.

Column styling​

columnCss receives a card array and the column view. The card array depends on which element gets the class:

Elementcards
Column (.wx-column)All cards of the column
Swimlane cell (.wx-lane-cell)That lane's cards in the column
Stack group (.wx-stack-group)That group's cards

The column view also carries custom fields from the column config. The example below reads a custom wipLimit key:

import "./board.css";
import { Kanban, Willow } from "@svar-ui/react-kanban";

const columns = [
{ id: "todo", label: "To do", wipLimit: 5 },
{ id: "doing", label: "In progress", wipLimit: 2 },
{ id: "done", label: "Done" },
];

const columnCss = (cards, column) => {
if (cards.length > column.wipLimit) return "col-wip-exceeded";
if (cards.length === 0) return "col-empty";
return "";
};

function App() {
return (
<Willow>
<div className="board-wrapper">
<Kanban cards={cards} columns={columns} columnCss={columnCss} />
</div>
</Willow>
);
}
/* board.css */
.board-wrapper .wx-column.col-wip-exceeded {
background: #fef2f2;
}
.board-wrapper .wx-column.col-empty {
opacity: 0.7;
}

CSS classes reference​

These class names are stable and safe to target in custom stylesheets:

ClassElementApplied when
wx-kanbanBoard rootAlways
wx-boardScroll wrapperAlways
wx-columnColumn sectionAlways
wx-collapsed.wx-columnColumn is collapsed
wx-column-headerColumn headerColumn is expanded
wx-column-cardsCard scroll containerAlways
wx-cardCard article elementAlways
wx-card-rowWrapper around each cardAlways
wx-dragging.wx-card-rowCard is being dragged
wx-drop-placeholderDrop hintDrag is over the column
wx-card-priority-lowPriority chipCard priority is Low
wx-card-priority-mediumPriority chipCard priority is Medium
wx-card-priority-highPriority chipCard priority is High
wx-editor-kanbanEditor wrapperAlways

For the layout classes on .wx-board, see Board state classes.

Summary tags and card list slots​

Column summary tags​

Each column summary renders as a .wx-column-summary tag in the column header. The css of a summary config adds classes to that tag only. It doesn't touch the column or the other tags. The tag background comes from --wx-kanban-tag-bg.

The base .wx-column-summary style is component-scoped, so a plain .my-class selector loses to it. Use at least .wx-column-summary.my-class specificity:

.wx-column-summary.effort-over-capacity {
color: #b91c1c;
}

To color the whole column for the same condition, return a class from columnCss. The column view carries the same custom keys (such as wipLimit) that the summary reads.

Card list slots​

Components passed to the card list slots render inside .wx-card-list-start (before the cards) and .wx-card-list-end (after the cards). Both wrappers sit inside .wx-column-cards. Style the content of your component, not the wrapper. The wrapper contains child margins, so keep spacing inside your component. That way, the measured height of the start slot includes the spacing.

In flow lists, --wx-card-gap (default 8px) sets the gap between the slots and the card grid:

.my-board {
--wx-card-gap: 12px;
}