render
Layout mode, scroll mode, column width, and card/column virtualization settings. These settings affect rendering only.
Usage
render?: RenderConfig;
| Field | Type | Default | Description |
|---|---|---|---|
layout | "board" | "stack" | "board" | "board": columns side by side. "stack": the whole board as one vertical column of groups, for narrow screens. See the stack layout guide. |
columnScroll | boolean | true | true: each column scrolls independently (classic Trello). false: the whole board shares one vertical scrollbar with sticky column headers. Swimlanes and the stack layout always use board scroll. |
fixedColumnWidth | boolean | true | true: every column is a fixed 280px. false: columns share the viewport width equally, with a 240px minimum. Ignored in the stack layout. |
virtualizeCards | boolean | false | Renders only the visible card slice per column. |
virtualizeColumns | boolean | false | Column shells stay mounted, but off-screen columns skip rendering card content. In the stack layout, it gates request-data on vertical visibility instead. |
estimatedCardHeight | number | 80 | Height estimate (in pixels) for unmeasured cards. |
cardOverscan | number | 5 | Extra cards rendered above and below the visible window as a scroll buffer. |
columnOverscan | number | 1 | Extra columns rendered before and after the horizontal viewport. Ignored in the stack layout. |
All fields are optional. Omitted fields use their defaults.
The widget doesn't detect viewport width. The app resolves the breakpoint and passes the layout value. Changing layout switches the layout without touching the store.
With swimlanes or layout: "stack", the board always uses one shared scroll, whatever columnScroll says. The columnScroll value applies again after switching back from the stack layout.
Example
Default behavior (per-column scroll, fixed-width columns, no virtualization):
<Kanban {cards} {columns} />
Flex columns that share the viewport width:
<Kanban {cards} {columns} render={{ fixedColumnWidth: false }} />
Board-wide scroll with sticky headers:
<Kanban {cards} {columns} render={{ columnScroll: false }} />
Flex columns with board-wide scroll:
<Kanban
{cards}
{columns}
render={{ columnScroll: false, fixedColumnWidth: false }}
/>
Card virtualization for large datasets:
<Kanban
{cards}
{columns}
render={{
virtualizeCards: true,
estimatedCardHeight: 96,
cardOverscan: 8,
}}
/>
Stack layout on narrow screens, with the breakpoint resolved by the app:
<script>
let narrow = $state(false);
$effect(() => {
const mq = window.matchMedia("(max-width: 640px)");
const sync = () => (narrow = mq.matches);
sync();
mq.addEventListener("change", sync);
return () => mq.removeEventListener("change", sync);
});
</script>
<Kanban
{cards}
{columns}
render={{ layout: narrow ? "stack" : "board", virtualizeCards: true }}
/>
Full virtualization (cards and columns):
<Kanban
{cards}
{columns}
render={{
virtualizeCards: true,
virtualizeColumns: true,
estimatedCardHeight: 96,
}}
/>
Related
- Stack layout guide - one vertical column of groups for narrow screens
- Columns guide - layout - scroll modes and column width
- Columns guide - performance - card and column virtualization