Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

(this page was created automatically. In case of formatting issues, please visit the official Wiki Page)

Tree View

Link to Figma: tba

Overview

  • The Dynamic Tree View component displays data in a collapsible hierarchical tree structure.
  • It allows users to explore nested information through parent-child relationships.
  • The component supports navigation and selection of nodes within the hierarchy.
  • It is useful for representing structures such as organizations, file systems, and categories.

[IMAGE PLACEHOLDER: Tree View showing collapsed and expanded parent-child nodes] Example Tree ViewImage Added

Specs

Tokens

TokenDescription
displayNameDisplay name of the component in the structure panel
displayExpressionField from data shown as text in tree nodes
keyExpressionField used as unique identifier for each node
childrenExpressionField containing child items for each node
selectionModeDetermines how users can select nodes
showCheckBoxesModeControls how checkboxes are displayed
selectNodesRecursiveSelects child nodes when parent is selected
selectByClickEnables or disables selection on click
paddingClassConfigures padding around the component
dataSourceIdID of the data source for retrieving tree data
getEntityCollectionHttpRequestParametersMapConfigures HTTP parameters for fetching data
eventsConfigurable events for the component
ON_TREE_ITEM_CLICK (Events)Triggered when a node is clicked
ON_INIT (Events)Triggered when the component initializes
ON_DESTROY (Events)Triggered when the component is destroyed
visibilityPolicySetIdDetermines visibility based on policy sets
displayConditionsConditions for dynamically showing the component
idUnique identifier for programmatic access
dataTestIdTesting hook ID for automated tests
enableAsHotspotEnables the component as a guided tour hotspot
guidedTourHotSpotTitleTitle for guided tour hotspot (multi-language)
guidedTourHotSpotDescriptionDescription for guided tour hotspot (multi-language)

...

  • dataSourceId – Specifies the data source ID for retrieving tree data. For example, "api/categories" connects the tree view to a categories API endpoint.
  • getEntityCollectionHttpRequestParametersMap – Configures HTTP parameters for data fetching. This object maps additional parameters needed for the data request, such as filters or sorting options. For example, {"headers": {"Content-Type": "application/json"}, "pathParams": {"tenantId": "{{tenantId}}"}} allows you to pass dynamic path parameters to the API.

[IMAGE PLACEHOLDER: Tree View structure with parent-child nodes, display conditions, event handling, and mapped fields]

Styling

(Configured in General Properties)

...

  • showCheckBoxesMode – Controls how checkboxes are displayed in the tree view. Options include "none" (no checkboxes), "normal" (checkboxes shown for all nodes), or "selectAll" (includes a select all checkbox). For example, using "selectAll" is helpful when users need to select multiple items in a permissions tree.
  • paddingClass – Configures the padding around the component using CSS classes. For example, "p-4" adds medium padding on all sides of the tree view, while "px-3 py-2" adds different horizontal and vertical padding. Proper padding ensures the tree view has adequate spacing within its container.

[IMAGE PLACEHOLDER: Tree View with display name, checkboxes, and padding highlighted] Tree View without checkboxesImage Added

Actions & Variants

...

(Configured in Visual Properties)

  • selectionMode — Determines how users can select nodes in the tree. Options include "single" (only one node can be selected at a time), "multiple" (multiple nodes can be selected simultaneously), or null (no selection allowed). For example, setting to "multiple" allows users to select several categories in a product catalog

    tree. selectNodesRecursive — Determines if selecting a parent node automatically selects all its child nodes. When set to true, clicking a parent node selects all its children recursively, which is useful for operations that apply to entire branches of the

    tree.

  • selectByClick — Enables or disables node selection when clicking on a node. When set to true, users can select a node by clicking anywhere on it; when false, they must use checkboxes (if enabled) to select nodes. This provides flexibility in how users interact with the tree.

...

  • Tree View with singe selectionImage Added

  • selectNodesRecursive — Determines if selecting a parent node automatically selects all its child nodes. When set to true, clicking a parent node selects all its children recursively, which is useful for operations that apply to entire branches of the tree.
    Recursive selectionImage Added

Tests

(Configured in Testing Hooks)

...

  • visibilityPolicySetId — Determines the visibility of the component based on specified policy sets. For example, setting to "categoryAdminPolicy" restricts the tree view to users with category management privileges. This enables role-based access control for the component, ensuring only authorized users can see and interact with certain hierarchical data.
  • Link to Figma: tba
  • Live style guide: https://e1-dev.k8s.myapp.de/live-style-guide/id2/9-tree

Guidelines

Data Format

The tree view component expects a hierarchical data structure or a flat structure that can be converted to a hierarchy.

...

DoDon’tArticle setting(s)
Use stable unique keys for nodes.Use labels or array indices as identifiers.keyExpression
Map human-readable text to nodes.Surface internal IDs or verbose blobs as labels.displayExpression
Set selectionMode: "single" for navigation trees.Allow multi-select when only one target makes sense.selectionMode
Show checkboxes for multi-select tasks.Force multi-select without visible affordances.showCheckBoxesMode, selectionMode
Enable selectNodesRecursive for branch actions.Make users select every child manually.selectNodesRecursive
Require checkbox-only selection when precision matters.Allow row-click selection that causes accidental picks.selectByClick: false, showCheckBoxesModeFilter at the source to limit payload.Fetch unbounded datasets without parameters.getEntityCollectionHttpRequestParametersMap, dataSourceId
Hide the Tree View when not applicable.Leave an empty/irrelevant tree visible.displayConditions
Restrict sensitive trees by policy.Show structure and rely on downstream errors.visibilityPolicySetIdProvide stable test hooks.Target nodes by transient text in tests.dataTestId, id

Accessibility

  • Programmatic names for nodes: Ensure meaningful labels by mapping displayExpression to human-readable text.
  • Explicit selection affordance for multi-select: Show checkboxes to convey state non-visually using showCheckBoxesMode with selectionMode: "multiple".
  • Accidental-selection prevention: When precision is needed, disable row-click with selectByClick: false.
  • Localized helper text for guided flows: If tours are used, provide localized titles/descriptions via enableAsHotspot, guidedTourHotSpotTitle, guidedTourHotSpotDescription.
  • Deterministic test/a11y hooks: Expose stable handles for audit tooling with dataTestId and id.
  • Avoid color-only meaning: Convey selection and hierarchy via labels and checkbox presence using displayExpression and showCheckBoxesMode.Predictable interactions: Establish selection behavior on init (e.g., set selectionMode and selectByClick in ON_INIT) and keep it stable during a session.
  • Stable relationships: Use persistent identifiers so assistive tech can track nodes; configure keyExpression and hierarchical relations via childrenExpression.