Skip to main content

render

Layout mode, scroll mode, column width, and card/column virtualization settings. These settings affect rendering only.

Usage​

render?: RenderConfig;
FieldTypeDefaultDescription
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.
columnScrollbooleantruetrue: 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.
fixedColumnWidthbooleantruetrue: every column is a fixed 280px. false: columns share the viewport width equally, with a 240px minimum. Ignored in the stack layout.
virtualizeCardsbooleanfalseRenders only the visible card slice per column.
virtualizeColumnsbooleanfalseColumn shells stay mounted, but off-screen columns skip rendering card content. In the stack layout, it gates request-data on vertical visibility instead.
estimatedCardHeightnumber80Height estimate (in pixels) for unmeasured cards.
cardOverscannumber5Extra cards rendered above and below the visible window as a scroll buffer.
columnOverscannumber1Extra 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,
}}
/>