Unify Applications
Logo
Tree View & Kanban

Tree View & Kanban

Logo

8 mins READ

Tree View Block

The Tree View block renders hierarchical data as an indented tree of expandable, collapsible nodes — folders inside folders, categories inside categories, component trees. You bind it to an array where each item can carry a nested array of children under a key you choose. Like a Repeatable, every node renders a child layout you design, and inside that layout each node exposes its own item, index, level, hasChildren, and expansion state.

tree_view.png
tree_view.png

Tip: Use it for data that is already nested and needs to be drilled into inline — file trees, category trees, menu structures. For org hierarchies stored as flat records with a parent-ID field, use the Organization Chart block, which builds and lays out the tree for you. There is no built-in single selection; the tree tracks which nodes are open, and clicking fires an event you handle yourself.

Content Properties

Property

Type

Default

Description

Data (data)

array (bindable)

Sample nested tree

The hierarchical list the tree is built from. Each item may hold a nested array of children.

Primary Key (primaryKey)

field mapping

id

The unique identifier for each item — how the tree remembers expanded nodes, matches drag targets, and keys the child layout. It must be unique across the whole tree, not just among siblings.

Nested Data Key (nestedDataKey)

field mapping

children

The property on each item that holds its array of children. Makes an item a parent with an expandable branch.

Collect Child States (collectChildStates)

boolean

off

When on, states of blocks rendered inside each node are collected for binding.

Expand All Nodes by Default (defaultExpandAll)

boolean

off

When on, every branch that has children starts expanded on load.

Enable Drag & Drop (enableDragNDrop)

boolean

off

Lets users drag nodes to re-order siblings and re-nest them. Only appears once a Primary Key is set.

Drop Behavior (dragNDropMode)

Drop Anywhere | Drop at Same Level

Drop Anywhere

Controls where a dragged node may land. Appears when Enable Drag & Drop is on.

Events

EventTriggerPayload
On Node ClickUser clicks anywhere on a node rowitem, index, level, hasChildren, isExpanded
On Node ExpandA node opens via chevron or toggleNode methodSame node fields, isExpanded true
On Node CollapseA node closesSame node fields, isExpanded false
On Order ChangeA dragged node is dropped in a new positionitem, oldPosition, newPosition (each has parentId + index)

Methods

MethodParamsDescription
toggleNodenodeKeyOpens the node if closed, closes it if open. Emits expand/collapse when the node is visible.
expandAll—Opens every node that has children. Emits no per-node events.
collapseAll—Closes every node. Emits no per-node events.

Exposed State

State KeyTypeDescription
{{ id.expandedNodeIds }}arrayPrimary-key values of nodes currently open
{{ id.currentData }}arrayHierarchy re-ordered to match any drag-and-drop moves
{{ id.order }}objectrootOrder plus childOrderByParentId — empty until a node is dragged
{{ id.draggingNode }}objectThe node being dragged right now, or empty when nothing is dragging
{{ id.context }}objectInside a node's layout only: item, index, level, hasChildren, isExpanded

Note: Tree View tracks which nodes are open — there is no selectedNode state. Capture the clicked node yourself from the On Node Click event payload.

Tree View Gotchas

⚠ Clearing Primary Key disables drag-and-drop silently

If you enable drag-and-drop then clear the Primary Key, dragging stops working with no warning. Always keep a stable unique ID mapped when relying on node reordering.

⚠ Primary Key must be unique across the whole tree

Without a Primary Key, a node's ID is its position among its siblings, which repeats at every level. Because the list of open nodes is one flat list for the whole tree, expanding or collapsing a node can then affect the wrong one. Map a field that is unique across every level.

⚠ Drag-and-drop does not save the new order

Reordering only changes what is on screen. It is not written back to your data or data source, so the order reverts when the page reloads. To keep it, read currentData (or the On Order Change payload) and save it through an action.

Kanban Block

The Kanban block renders a board of columns and draggable cards from a column-shaped data array. Each element of the array supplies one lane — a category value that names the lane and an items array that fills it with cards. Every card renders the same card template with that item's data in scope.

Warning: The board does not group a flat list of records for you. Your data source must return an array where each element represents one lane, with the lane name in one field and its cards in an array field. Group flat records upstream before binding.

📄 Expected Data Shape

[ { "category": "To Do", "items": [ { "id": "1", "label": "Task A" } ] }, { "category": "Doing", "items": [ { "id": "2", "label": "Task B" } ] }, { "category": "Done", "items": [] } ]

Content Properties

PropertyTypeDefaultDescription
dataarray (bindable)Sample task board (6 columns)The column-shaped array. One element per column.
category (Mapped Category)field mapping + formatcategory field, String formatWhich field on each row becomes the column name. Supports String and Date formats.
itemsConfig (Mapped Items)field mappingsitems array, id keyThe items array field and unique per-item ID. Both required for cards to render.
slots (Column Header)slotCategory title + item countOne shared block rendered at the top of every column. Context bindings available inside.

Appearance Properties

PropertyTypeDefaultDescription
column.backgroundColorcolorIndigo tintBackground of every column. Supports conditional colors.
column.minWidthpreset / custom px260pxMinimum column width. Presets from 200px to 1024px or a custom value.
stylesstyle setheight 800pxBoard width/height, Column Gap between lanes, padding, border, shadow, overflow.

Column Configuration

Columns appear in the same order as the rows of the bound data array. Reorder the rows to reorder the lanes — there is no separate ordering control.

Category Formats

FormatDescription
StringRaw text value becomes the column name (default).
DateCategory values are treated as dates. Set a Date Format pattern. The formatted value is available as {{ kanban1.context.column.formattedCategory }}; grouping uses the raw value.

Column Header Context Bindings

BindingTypeDescription
{{ kanban1.context.column.category }}stringRaw category value naming this column
{{ kanban1.context.column.index }}numberZero-based position of the column on the board
{{ kanban1.context.column.itemCount }}numberHow many cards the column currently holds
{{ kanban1.context.column.formattedCategory }}stringCategory rendered through the date format, when one is set

Card Template

The board holds a single card block (the Items Card) rendered once per item in every column. Select it on the canvas or layers panel and edit it — every card on the board updates together.

Per-Card Context Bindings

BindingTypeDescription
{{ kanban1.context.item.* }}objectThe full item object this card renders — any field of the mapped item
{{ kanban1.context.column.category }}stringThe raw category of the column the card sits in
{{ kanban1.context.column.index }}numberZero-based column position
{{ kanban1.context.column.itemCount }}numberCards in this column

Events

EventTriggerPayload
On Select ItemA card is clicked anywhere on its surfaceClicked item in {{ id.selectedItem }}
On Drag ItemA drag startsitem, fromCategory, fromIndex
On Drop ItemA dragged card is releaseditem, toCategory, toIndex

Exposed State

State Key

Type

Description

{{ id.selectedItem }}

object

Selected Item — the card the user last clicked

{{ id.context.item }}

object

Inside the card template only: the item this card renders

{{ id.context.column }}

object

Inside the card template or Column Header slot only: the column's category, index, itemCount and formattedCategory

Kanban has no methods of its own. To change the board, update its bound data and refetch the data source.

Kanban Gotchas

⚠ Duplicate category rows collapse silently

Columns are keyed by category value. When two data rows share the same value, the later row's items replace the earlier row's — they are not merged. A row with an empty category is dropped entirely.

⚠ You cannot show a column that has no data row

A lane exists only if a row of the data produces it. To keep an empty "Done" column visible, the data must still contain a row with Done as its category and an empty items array.

⚠ Item IDs must be unique across the whole board

Two items sharing an ID across different columns confuse drag-and-drop. The board finds the first match and can move the wrong card. Pick a field that is unique board-wide.

⚠ A missing Item ID shows an error instead of the board

If the ID mapping is empty or the first item has no value at that field, the whole board is replaced by an error panel. Validation samples the first item only — missing IDs deeper in the data are not caught up front.

⚠ Starter header colors run out after six columns

The starter header has six preset background colors, one for each of the first six columns. A seventh column gets no background (and white text) until you add more conditions.

Kanban Patterns

Task Pipeline

  1. Group your data: Group flat task records by status upstream (in your data source or a transformation) to produce the column-shaped array with a category field and an items array.

  2. Configure mappings: Set Mapped Category → Name to status and Mapped Items → Data to items, ID to id.

  3. Handle drag events: On On Drop Item, call your API to update the task's status to toCategory, then refetch the data.

Date-Bucketed Board

  1. Set category format to Date: In Mapped Category → Format, choose Date and pick a date pattern (e.g., d MMM).

  2. Bind the formatted title: In the Column Header slot, bind the title block to {{ kanban1.context.column.formattedCategory }} (not category) to show the formatted date.

Block

Relationship

Repeatable

For flat repeated layouts without lanes or between-group dragging

Organization Chart

For org hierarchies stored as flat records with a parent-ID field — it builds and lays out the tree automatically

Table

Prefer for dense columnar records with sorting and filtering

FAQs

Why are my Kanban columns not showing?

The Kanban block requires data in a specific shape: an array of objects each with a category key and an items array. If your data source returns flat records (one row per item), you must transform it into the column-shaped format first — either with a data transformer or a server-side query that groups items by stage.

Can I disable drag-and-drop in Kanban?

No. The Kanban block has no setting to turn drag-and-drop off, so cards can always be dragged between columns. If you don't want a move to be saved, don't update your data in the On Drop Item event. The card then only moves on screen and goes back to its saved column when the page reloads.

How do I programmatically expand or collapse all Tree View nodes?

Use the expandAll and collapseAll methods on the Tree View block. Trigger them from a button's On Click event using the Trigger Component Method action. To toggle a specific node by key, use the toggleNode method with the node's primary key as the argument.

After a Kanban drag-and-drop, how do I persist the new column for a card?

The On Drop Item event fires when a card is dropped into a new column. The event payload includes the item that was moved and the target column's category value. Use these in a Trigger API action to call your backend and update the item's stage field, then refresh the data source to re-render the board with the updated data.

Does Tree View drag-and-drop save the new order?

No. Drag-and-drop only changes what is on screen. The new order is not written back to your data or data source, so it reverts when the page reloads. To keep it, read currentData or the On Order Change event payload and save it through an action.