diff --git a/src/components/tree_view/__snapshots__/tree_view.test.tsx.snap b/src/components/tree_view/__snapshots__/tree_view.test.tsx.snap
index 498eff8e2b..63c1ffabb9 100644
--- a/src/components/tree_view/__snapshots__/tree_view.test.tsx.snap
+++ b/src/components/tree_view/__snapshots__/tree_view.test.tsx.snap
@@ -34,10 +34,28 @@ exports[`OuiTreeView is rendered 1`] = `
data-ouiicon-type="folderOpen"
/>
+
+
+
+
+
+
+
+
+
('');
@@ -118,6 +119,8 @@ export type CommonTreeProps = CommonProps &
* that contain children
*/
showExpansionArrows?: boolean;
+ /** Number of child components within tree view node
+ */
};
export type OuiTreeViewProps = Omit<
@@ -307,7 +310,7 @@ export class OuiTreeView extends Component
{
{items.map((node, index) => {
const buttonId = node.id;
const wrappingId = this.treeIdGenerator(buttonId);
-
+ const count = node.children?.length;
return (
{
{node.useEmptyIcon && !node.icon ? (
) : null}
-
- {node.label}
-
+ {count === 0 ? (
+
+ {node.label}
+
+ ) : (
+
+
+ {node.label}
+
+
+ )}