A powerful and flexible Tree View/List component for Budibase applications that supports hierarchical data display with advanced features including selection, menus, search, and multiple visualization modes.
This is a custom Budibase component plugin that needs to be imported into your Budibase instance.
Build the plugin package:
npm run build
For development with auto-rebuild:
npm run watch
After building, you have several options to import the plugin:
For faster development with hot reloading:
budi hosting --watch-plugin-dir /path-to-your-plugins-directory
budi hosting --start
npm run watch
Once imported:
Property | Type | Description | Default |
---|---|---|---|
datasource |
DataSource | Budibase data source | - |
idColumn |
String | Column used for node IDs | id |
labelColumn |
String | Column used for node labels | Primary display column |
labelTemplate |
String | Template string for node labels | - |
structuredData |
Boolean | Use structured data format | false |
Property | Type | Default | Description |
---|---|---|---|
treeType |
flat | recursive | groupBy |
flat |
Tree structure type |
controlType |
tree | list |
tree |
Display mode |
joinField |
String | - | Field for recursive relationships |
groupFields |
Array | - | Fields to group by (Group By mode) |
Property | Type | Default | Description |
---|---|---|---|
rootless |
Boolean | true |
Hide root node container |
header |
Boolean | true |
Show tree header |
branchName |
String | - | Custom root node text |
collapsed |
Boolean | true |
Start tree collapsed |
showCount |
Boolean | true |
Show item counts |
chevronPosition |
left | right |
left |
Chevron icon position |
Property | Type | Default | Description |
---|---|---|---|
searchMode |
false | client | server |
client |
Search implementation |
filter |
Array | - | Pre-configured filters |
sortColumn |
String | - | Sort field |
sortOrder |
ascending | descending |
- | Sort direction |
limit |
Number | 50 |
Row limit |
Property | Type | Default | Description |
---|---|---|---|
nodeSelection |
Boolean | false |
Enable node selection |
maxNodeSelection |
Number | 1 |
Maximum selections |
checkboxes |
Boolean | - | Show selection checkboxes |
selectedIds |
String | - | Pre-selected node IDs |
Property | Type | Description | Scope |
---|---|---|---|
quiet |
Boolean | Minimal styling | All |
nodeIcon |
String | Node icon | Nodes |
nodeIconTemplate |
String | Dynamic icon template | Nodes |
nodeFGColor |
String | Foreground color | Nodes |
nodeBGColor |
String | Background color | Nodes |
nodeIconColor |
String | Icon color | Nodes |
groupNodeIcon |
String | Group node icon | Groups |
groupFGColor |
String | Group foreground color | Groups |
groupBGColor |
String | Group background color | Groups |
Property | Type | Default | Description |
---|---|---|---|
headerMenu |
Boolean | false |
Enable header menu |
headerMenuItems |
Array | - | Header menu actions |
nodeMenu |
Boolean | false |
Enable node menu |
nodeMenuItems |
Array | - | Node menu actions |
groupMenu |
Boolean | false |
Enable group menu |
groupMenuItems |
Array | - | Group menu actions |
Event | Context | Description |
---|---|---|
onNodeSelect |
Node data, selection state | Node selection change |
onNodeClick |
Node data, click event | Node clicked |
onGroupSelect |
Group data, selection state | Group selection change |
onGroupClick |
Group data, click event | Group clicked |
In Budibase builder, configure these settings:
Configure for parent-child relationships:
For data grouped by categories:
Configure for flat list layout:
Use template strings to customize node appearance based on data:
{
"nodeIconTemplate": "{{#if completed}}✓{{/if}}",
"nodeFGColor": "{{#if priority === 'high'}}#e74c3c{{/if}}",
"nodeBGColor": "{{#if selected}}#e8f5e8{{/if}}"
}
{
"groupNodeIcon": "folder-fill",
"groupFGColor": "#2c3e50",
"groupBGColor": "#ecf0f1"
}
{{ SuperTree.selected }}
Configure contextual actions for different tree elements:
{
"nodeMenuItems": [
{
"text": "Edit Item",
"icon": "edit",
"onClick": {
"action": "updateRow",
"table": "{{ yourTable }}",
"rowId": "{{ row.id }}"
}
}
]
}
The SuperTree component supports complex nested structures:
Access SuperTree data in other components using Budibase bindings:
{{ SuperTree.selected }}
{{ SuperTree.selectedIds }}
{{ SuperTree.selectedPath }}
{{ SuperTree.group }}
Use these bindings in other components to access the tree's current state and selections.
Contributions welcome! Please ensure code follows Budibase component standards and includes proper TypeScript definitions.
This component is part of the Budibase ecosystem. See Budibase Licensing for details.