Repository: symfony/symfony-docs
Pull request #20786: [Console] Document the `TreeHelper`
Author: login: smnandre
Labels: name: Console
name: Status: Reviewed
Created: 2025-03-21T02:23:44Z | Merged: 2025-03-24T08:52:59Z

| Q | A |
| - | - |
| Feature PR | [symfony/symfony#59588](https://github.com/symfony/symfony/pull/59588) | 
| PR author(s) | [@smnandre](https://github.com/smnandre) | 
| Merged in | 7.3 | 
| Doc Issue | Fix #20692 |

fix #20692



Linked issue #20692: [Console] Add a Tree Helper + multiple Styles 
| Q            | A
| ------------ | ---
| Feature PR   | symfony/symfony#59588
| PR author(s) | @smnandre
| Merged in    | 7.3

We created this issue to not forget to document this new feature. We would really appreciate if you can help us with this task. If you are not sure how to do it, please ask us and we will help you.

To fix this issue, please create a PR against the 7.3 branch in the [symfony-docs repository](https://github.com/symfony/symfony-docs).

Thank you! :smiley:

Diff:
diff --git a/components/console/helpers/map.rst.inc b/components/console/helpers/map.rst.inc
index 8f9ce0ca0f3..b190d1dce44 100644
--- a/components/console/helpers/map.rst.inc
+++ b/components/console/helpers/map.rst.inc
@@ -3,5 +3,6 @@
 * :doc:`/components/console/helpers/progressbar`
 * :doc:`/components/console/helpers/questionhelper`
 * :doc:`/components/console/helpers/table`
+* :doc:`/components/console/helpers/tree`
 * :doc:`/components/console/helpers/debug_formatter`
 * :doc:`/components/console/helpers/cursor`
diff --git a/components/console/helpers/tree.rst b/components/console/helpers/tree.rst
new file mode 100644
index 00000000000..2e688770c65
--- /dev/null
+++ b/components/console/helpers/tree.rst
@@ -0,0 +1,237 @@
+Tree Helper
+===========
+
+The Tree Helper allows you to build and display tree structures in the console.
+
+.. versionadded:: 7.3
+
+    The ``TreeHelper`` class was introduced in Symfony 7.3.
+
+Rendering a Tree
+----------------
+
+The :method:`Symfony\\Component\\Console\\Helper\\TreeHelper::createTree` method creates a tree structure from an array and returns a :class:`Symfony\\Component\\Console\\Helper\\Tree`
+object that can be rendered in the console.
+
+Building a Tree from an Array
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can build a tree from an array by passing the array to the :method:`Symfony\\Component\\Console\\Helper\\TreeHelper::createTree`
+method::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+
+    $tree = TreeHelper::createTree($io, null, [
+        'src' =>  [
+            'Command',
+            'Controller' => [
+                'DefaultController.php',
+            ],
+            'Kernel.php',
+        ],
+        'templates' => [
+            'base.html.twig',
+        ],
+    ]);
+
+    $tree->render();
+
+The above code will output the following tree:
+
+.. code-block:: text
+
+    ├── src
+    │   ├── Command
+    │   ├── Controller
+    │   │   └── DefaultController.php
+    │   └── Kernel.php
+    └── templates
+        └── base.html.twig
+
+Manually Creating a Tree
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can manually create a tree by creating a new instance of the :class:`Symfony\\Component\\Console\\Helper\\Tree` class and adding nodes to it::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+    use Symfony\Component\Console\Helper\TreeNode;
+
+    $node = TreeNode::fromValues([
+        'Command',
+        'Controller' => [
+            'DefaultController.php',
+        ],
+        'Kernel.php',
+    ]);
+    $node->addChild('templates');
+    $node->addChild('tests');
+
+    $tree = TreeHelper::createTree($io, $node);
+    $tree->render();
+
+Customizing the Tree Style
+--------------------------
+
+Built-in Tree Styles
+~~~~~~~~~~~~~~~~~~~~
+
+The tree helper provides a few built-in styles that you can use to customize the output of the tree.
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::default`
+
+    .. code-block:: text
+
+        ├── config
+        │   ├── packages
+        │   └── routes
+        │      ├── framework.yaml
+        │      └── web_profiler.yaml
+        ├── src
+        │   ├── Command
+        │   ├── Controller
+        │   │   └── DefaultController.php
+        │   └── Kernel.php
+        └── templates
+           └── base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::box`
+
+    .. code-block:: text
+
+        ┃╸ config
+        ┃  ┃╸ packages
+        ┃  ┗╸ routes
+        ┃     ┃╸ framework.yaml
+        ┃     ┗╸ web_profiler.yaml
+        ┃╸ src
+        ┃  ┃╸ Command
+        ┃  ┃╸ Controller
+        ┃  ┃  ┗╸ DefaultController.php
+        ┃  ┗╸ Kernel.php
+        ┗╸ templates
+           ┗╸ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::doubleBox`
+
+    .. code-block:: text
+
+        ╠═ config
+        ║  ╠═ packages
+        ║  ╚═ routes
+        ║    ╠═ framework.yaml
+        ║    ╚═ web_profiler.yaml
+        ╠═ src
+        ║  ╠═ Command
+        ║  ╠═ Controller
+        ║  ║  ╚═ DefaultController.php
+        ║  ╚═ Kernel.php
+        ╚═ templates
+          ╚═ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::compact`
+
+    .. code-block:: text
+
+        ├ config
+        │ ├ packages
+        │ └ routes
+        │   ├ framework.yaml
+        │   └ web_profiler.yaml
+        ├ src
+        │ ├ Command
+        │ ├ Controller
+        │ │ └ DefaultController.php
+        │ └ Kernel.php
+        └ templates
+          └ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::light`
+
+    .. code-block:: text
+
+        |-- config
+        |   |-- packages
+        |   `-- routes
+        |       |-- framework.yaml
+        |       `-- web_profiler.yaml
+        |-- src
+        |   |-- Command
+        |   |-- Controller
+        |   |   `-- DefaultController.php
+        |   `-- Kernel.php
+        `-- templates
+            `-- base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::minimal`
+
+    .. code-block:: text
+
+        . config
+        . . packages
+        . . routes
+        .   . framework.yaml
+        .   . web_profiler.yaml
+        . src
+        . . Command
+        . . Controller
+        . . . DefaultController.php
+        . . Kernel.php
+        . templates
+          . base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::rounded`
+
+    .. code-block:: text
+
+        ├─ config
+        │  ├─ packages
+        │  ╰─ routes
+        │     ├─ framework.yaml
+        │     ╰─ web_profiler.yaml
+        ├─ src
+        │  ├─ Command
+        │  ├─ Controller
+        │  │  ╰─ DefaultController.php
+        │  ╰─ Kernel.php
+        ╰─ templates
+           ╰─ base.html.twig
+
+Making a Custom Tree Style
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can create your own tree style by passing the characters to the constructor
+of the :class:`Symfony\\Component\\Console\\Helper\\TreeStyle` class::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+    use Symfony\Component\Console\Helper\TreeStyle;
+
+    $customStyle = new TreeStyle('🟣 ', '🟠 ', '🔵 ', '🟢 ', '🔴 ', '🟡 ');
+
+    // Pass the custom style to the createTree method
+
+    $tree = TreeHelper::createTree($io, null, [
+        'src' =>  [
+            'Command',
+            'Controller' => [
+                'DefaultController.php',
+            ],
+            'Kernel.php',
+        ],
+        'templates' => [
+            'base.html.twig',
+        ],
+    ], $customStyle);
+
+    $tree->render();
+
+The above code will output the following tree:
+
+.. code-block:: text
+
+    🔵 🟣 🟡 src
+    🔵 🟢 🟣 🟡 Command
+    🔵 🟢 🟣 🟡 Controller
+    🔵 🟢 🟢 🟠 🟡 DefaultController.php
+    🔵 🟢 🟠 🟡 Kernel.php
+    🔵 🟠 🟡 templates
+    🔵 🔴 🟠 🟡 base.html.twig
diff --git a/console/style.rst b/console/style.rst
index 0aaaa3f675e..e1e5df38ffe 100644
--- a/console/style.rst
+++ b/console/style.rst
@@ -169,6 +169,32 @@ Content Methods
     styled according to the Symfony Style Guide, which allows you to use
     features such as dynamically appending rows.
 
+:method:`Symfony\\Component\\Console\\Style\\SymfonyStyle::tree`
+    It displays the given nested array as a formatted directory/file tree
+    structure in the console output::
+
+        $io->tree([
+            'src' =>  [
+                'Controller' => [
+                    'DefaultController.php',
+                ],
+                'Kernel.php',
+            ],
+            'templates' => [
+                'base.html.twig',
+            ],
+        ]);
+
+.. versionadded:: 7.3
+
+    The ``SymfonyStyle::tree()`` and the ``SymfonyStyle::createTree()`` methods
+    were introduced in Symfony 7.3.
+
+:method:`Symfony\\Component\\Console\\Style\\SymfonyStyle::createTree`
+    Creates an instance of :class:`Symfony\\Component\\Console\\Helper\\TreeHelper`
+    styled according to the Symfony Style Guide, which allows you to use
+    features such as dynamically nesting nodes.
+
 :method:`Symfony\\Component\\Console\\Style\\SymfonyStyle::newLine`
     It displays a blank line in the command output. Although it may seem useful,
     most of the times you won't need it at all. The reason is that every helper


Reviews:
user: login: OskarStark
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-21T08:19:05Z
user: login: OskarStark
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-21T08:19:44Z
user: login: smnandre
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-21T09:47:32Z
user: login: alamirault
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-21T10:37:42Z
user: login: OskarStark
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-21T16:41:14Z
user: login: smnandre
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-21T17:25:07Z
user: login: OskarStark
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-22T07:29:09Z
user: login: OskarStark
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-22T07:29:55Z
user: login: smnandre
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-24T03:22:18Z

Review comments:
diff_hunk: @@ -0,0 +1,233 @@
+Tree Helper
+===========
+
+The Tree Helper allows you to build and display tree structures in the console.
+
+Rendering a Tree
+----------------
+
+The :method:`Symfony\\Component\\Console\\Helper\\TreeHelper::createTree` method creates a tree structure from an array and returns a :class:`Symfony\\Component\\Console\\Helper\\Tree`
+object that can be rendered in the console.
+
+Building a Tree from an Array
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can build a tree from an array by passing the array to the :method:`Symfony\\Component\\Console\\Helper\\TreeHelper::createTree`
+method::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+
+    $tree = TreeHelper::createTree($io, null, [
+        'src' =>  [
+            'Command',
+            'Controller' => [
+                'DefaultController.php',
+            ],
+            'Kernel.php',
+        ],
+        'templates' => [
+            'base.html.twig',
+        ],
+    ]);
+
+    $tree->render();
+
+The above code will output the following tree:
+
+.. code-block:: text
+
+    ├── src
+    │   ├── Command
+    │   ├── Controller
+    │   │   └── DefaultController.php
+    │   └── Kernel.php
+    └── templates
+        └── base.html.twig
+
+Manually Creating a Tree
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can manually create a tree by creating a new instance of the :class:`Symfony\\Component\\Console\\Helper\\Tree` class and adding nodes to it::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+    use Symfony\Component\Console\Helper\TreeNode;
+
+    $node = TreeNode::fromValues([
+        'Command',
+        'Controller' => [
+            'DefaultController.php',
+        ],
+        'Kernel.php',
+    ]);
+    $node->addChild('templates');
+    $node->addChild('tests');
+
+    $tree = TreeHelper::createTree($io, $node);
+    $tree->render();
+
+Customizing the Tree Style
+--------------------------
+
+Built-in Tree Styles
+~~~~~~~~~~~~~~~~~~~~
+
+The tree helper provides a few built-in styles that you can use to customize the output of the tree.
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::default`
+
+    .. code-block:: text
+
+        ├── config
+        │   ├── packages
+        │   └── routes
+        │      ├── framework.yaml
+        │      └── web_profiler.yaml
+        ├── src
+        │   ├── Command
+        │   ├── Controller
+        │   │   └── DefaultController.php
+        │   └── Kernel.php
+        └── templates
+           └── base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::box`
+
+    .. code-block:: text
+
+        ┃╸ config
+        ┃  ┃╸ packages
+        ┃  ┗╸ routes
+        ┃     ┃╸ framework.yaml
+        ┃     ┗╸ web_profiler.yaml
+        ┃╸ src
+        ┃  ┃╸ Command
+        ┃  ┃╸ Controller
+        ┃  ┃  ┗╸ DefaultController.php
+        ┃  ┗╸ Kernel.php
+        ┗╸ templates
+           ┗╸ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::doubleBox`
+
+    .. code-block:: text
+
+        ╠═ config
+        ║  ╠═ packages
+        ║  ╚═ routes
+        ║    ╠═ framework.yaml
+        ║    ╚═ web_profiler.yaml
+        ╠═ src
+        ║  ╠═ Command
+        ║  ╠═ Controller
+        ║  ║  ╚═ DefaultController.php
+        ║  ╚═ Kernel.php
+        ╚═ templates
+          ╚═ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::compact`
+
+    .. code-block:: text
+
+        ├ config
+        │ ├ packages
+        │ └ routes
+        │   ├ framework.yaml
+        │   └ web_profiler.yaml
+        ├ src
+        │ ├ Command
+        │ ├ Controller
+        │ │ └ DefaultController.php
+        │ └ Kernel.php
+        └ templates
+          └ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::light`
+
+    .. code-block:: text
+
+        |-- config
+        |   |-- packages
+        |   `-- routes
+        |       |-- framework.yaml
+        |       `-- web_profiler.yaml
+        |-- src
+        |   |-- Command
+        |   |-- Controller
+        |   |   `-- DefaultController.php
+        |   `-- Kernel.php
+        `-- templates
+            `-- base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::minimal`
+
+    .. code-block:: text
+
+        . config
+        . . packages
+        . . routes
+        .   . framework.yaml
+        .   . web_profiler.yaml
+        . src
+        . . Command
+        . . Controller
+        . . . DefaultController.php
+        . . Kernel.php
+        . templates
+          . base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::rounded`
+
+    .. code-block:: text
+
+        ├─ config
+        │  ├─ packages
+        │  ╰─ routes
+        │     ├─ framework.yaml
+        │     ╰─ web_profiler.yaml
+        ├─ src
+        │  ├─ Command
+        │  ├─ Controller
+        │  │  ╰─ DefaultController.php
+        │  ╰─ Kernel.php
+        ╰─ templates
+           ╰─ base.html.twig
+
+Making a Custom Tree Style
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can create your own tree style by passing the characters to the constructor
+of the :class:`Symfony\\Component\\Console\\Helper\\TreeStyle` class::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+    use Symfony\Component\Console\Helper\TreeStyle;
+
+    $customStyle = new TreeStyle('🟣 ', '🟠 ', '🔵 ', '🟢 ', '🔴 ', '🟡 ');
+
+    // Pass the custom style to the createTree method
+
+    $tree = TreeHelper::createTree($io, null, [
+        'src' =>  [
+            'Command',
+            'Controller' => [
+                'DefaultController.php',
+            ],
+            'Kernel.php',
+        ],
+        'templates' => [
+            'base.html.twig',
+        ],
+    ], $customStyle);
+
+    $tree->render();
+
+The above code will output the following tree:
+
+.. code-block:: text
+
+    🔵 🟣 🟡 src
path: components/console/helpers/tree.rst
user: login: OskarStark
body: I love this example ❤️
created_at: 2025-03-21T08:19:01Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,233 @@
+Tree Helper
+===========
+
+The Tree Helper allows you to build and display tree structures in the console.
+
+Rendering a Tree
+----------------
+
+The :method:`Symfony\\Component\\Console\\Helper\\TreeHelper::createTree` method creates a tree structure from an array and returns a :class:`Symfony\\Component\\Console\\Helper\\Tree`
+object that can be rendered in the console.
+
+Building a Tree from an Array
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can build a tree from an array by passing the array to the :method:`Symfony\\Component\\Console\\Helper\\TreeHelper::createTree`
+method::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+
+    $tree = TreeHelper::createTree($io, null, [
+        'src' =>  [
+            'Command',
+            'Controller' => [
+                'DefaultController.php',
+            ],
+            'Kernel.php',
+        ],
+        'templates' => [
+            'base.html.twig',
+        ],
+    ]);
+
+    $tree->render();
+
+The above code will output the following tree:
+
+.. code-block:: text
+
+    ├── src
+    │   ├── Command
+    │   ├── Controller
+    │   │   └── DefaultController.php
+    │   └── Kernel.php
+    └── templates
+        └── base.html.twig
+
+Manually Creating a Tree
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can manually create a tree by creating a new instance of the :class:`Symfony\\Component\\Console\\Helper\\Tree` class and adding nodes to it::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+    use Symfony\Component\Console\Helper\TreeNode;
+
+    $node = TreeNode::fromValues([
+        'Command',
+        'Controller' => [
+            'DefaultController.php',
+        ],
+        'Kernel.php',
+    ]);
+    $node->addChild('templates');
+    $node->addChild('tests');
+
+    $tree = TreeHelper::createTree($io, $node);
+    $tree->render();
+
+Customizing the Tree Style
+--------------------------
+
+Built-in Tree Styles
+~~~~~~~~~~~~~~~~~~~~
+
+The tree helper provides a few built-in styles that you can use to customize the output of the tree.
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::default`
+
+    .. code-block:: text
+
+        ├── config
+        │   ├── packages
+        │   └── routes
+        │      ├── framework.yaml
+        │      └── web_profiler.yaml
+        ├── src
+        │   ├── Command
+        │   ├── Controller
+        │   │   └── DefaultController.php
+        │   └── Kernel.php
+        └── templates
+           └── base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::box`
+
+    .. code-block:: text
+
+        ┃╸ config
+        ┃  ┃╸ packages
+        ┃  ┗╸ routes
+        ┃     ┃╸ framework.yaml
+        ┃     ┗╸ web_profiler.yaml
+        ┃╸ src
+        ┃  ┃╸ Command
+        ┃  ┃╸ Controller
+        ┃  ┃  ┗╸ DefaultController.php
+        ┃  ┗╸ Kernel.php
+        ┗╸ templates
+           ┗╸ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::doubleBox`
+
+    .. code-block:: text
+
+        ╠═ config
+        ║  ╠═ packages
+        ║  ╚═ routes
+        ║    ╠═ framework.yaml
+        ║    ╚═ web_profiler.yaml
+        ╠═ src
+        ║  ╠═ Command
+        ║  ╠═ Controller
+        ║  ║  ╚═ DefaultController.php
+        ║  ╚═ Kernel.php
+        ╚═ templates
+          ╚═ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::compact`
+
+    .. code-block:: text
+
+        ├ config
+        │ ├ packages
+        │ └ routes
+        │   ├ framework.yaml
+        │   └ web_profiler.yaml
+        ├ src
+        │ ├ Command
+        │ ├ Controller
+        │ │ └ DefaultController.php
+        │ └ Kernel.php
+        └ templates
+          └ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::light`
+
+    .. code-block:: text
+
+        |-- config
+        |   |-- packages
+        |   `-- routes
+        |       |-- framework.yaml
+        |       `-- web_profiler.yaml
+        |-- src
+        |   |-- Command
+        |   |-- Controller
+        |   |   `-- DefaultController.php
+        |   `-- Kernel.php
+        `-- templates
+            `-- base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::minimal`
+
+    .. code-block:: text
+
+        . config
+        . . packages
+        . . routes
+        .   . framework.yaml
+        .   . web_profiler.yaml
+        . src
+        . . Command
+        . . Controller
+        . . . DefaultController.php
+        . . Kernel.php
+        . templates
+          . base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::rounded`
+
+    .. code-block:: text
+
+        ├─ config
+        │  ├─ packages
+        │  ╰─ routes
+        │     ├─ framework.yaml
+        │     ╰─ web_profiler.yaml
+        ├─ src
+        │  ├─ Command
+        │  ├─ Controller
+        │  │  ╰─ DefaultController.php
+        │  ╰─ Kernel.php
+        ╰─ templates
+           ╰─ base.html.twig
+
+Making a Custom Tree Style
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can create your own tree style by passing the characters to the constructor
+of the :class:`Symfony\\Component\\Console\\Helper\\TreeStyle` class::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+    use Symfony\Component\Console\Helper\TreeStyle;
+
+    $customStyle = new TreeStyle('🟣 ', '🟠 ', '🔵 ', '🟢 ', '🔴 ', '🟡 ');
+
+    // Pass the custom style to the createTree method
+
+    $tree = TreeHelper::createTree($io, null, [
+        'src' =>  [
+            'Command',
+            'Controller' => [
+                'DefaultController.php',
+            ],
+            'Kernel.php',
+        ],
+        'templates' => [
+            'base.html.twig',
+        ],
+    ], $customStyle);
+
+    $tree->render();
+
+The above code will output the following tree:
+
+.. code-block:: text
+
+    🔵 🟣 🟡 src
+    🔵 🟢 🟣 🟡 Command
+    🔵 🟢 🟣 🟡 Controller
+    🔵 🟢 🟢 🟠 🟡 DefaultController.php
+    🔵 🟢 🟠 🟡 Kernel.php
+    🔵 🟠 🟡 templates
+    🔵 🔴 🟠 🟡 base.html.twig
path: components/console/helpers/tree.rst
user: login: OskarStark
body: Please add a versionadded directive below, like for other new features, thanks 
created_at: 2025-03-21T08:19:35Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,233 @@
+Tree Helper
+===========
+
+The Tree Helper allows you to build and display tree structures in the console.
+
+Rendering a Tree
+----------------
+
+The :method:`Symfony\\Component\\Console\\Helper\\TreeHelper::createTree` method creates a tree structure from an array and returns a :class:`Symfony\\Component\\Console\\Helper\\Tree`
+object that can be rendered in the console.
+
+Building a Tree from an Array
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can build a tree from an array by passing the array to the :method:`Symfony\\Component\\Console\\Helper\\TreeHelper::createTree`
+method::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+
+    $tree = TreeHelper::createTree($io, null, [
+        'src' =>  [
+            'Command',
+            'Controller' => [
+                'DefaultController.php',
+            ],
+            'Kernel.php',
+        ],
+        'templates' => [
+            'base.html.twig',
+        ],
+    ]);
+
+    $tree->render();
+
+The above code will output the following tree:
+
+.. code-block:: text
+
+    ├── src
+    │   ├── Command
+    │   ├── Controller
+    │   │   └── DefaultController.php
+    │   └── Kernel.php
+    └── templates
+        └── base.html.twig
+
+Manually Creating a Tree
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can manually create a tree by creating a new instance of the :class:`Symfony\\Component\\Console\\Helper\\Tree` class and adding nodes to it::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+    use Symfony\Component\Console\Helper\TreeNode;
+
+    $node = TreeNode::fromValues([
+        'Command',
+        'Controller' => [
+            'DefaultController.php',
+        ],
+        'Kernel.php',
+    ]);
+    $node->addChild('templates');
+    $node->addChild('tests');
+
+    $tree = TreeHelper::createTree($io, $node);
+    $tree->render();
+
+Customizing the Tree Style
+--------------------------
+
+Built-in Tree Styles
+~~~~~~~~~~~~~~~~~~~~
+
+The tree helper provides a few built-in styles that you can use to customize the output of the tree.
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::default`
+
+    .. code-block:: text
+
+        ├── config
+        │   ├── packages
+        │   └── routes
+        │      ├── framework.yaml
+        │      └── web_profiler.yaml
+        ├── src
+        │   ├── Command
+        │   ├── Controller
+        │   │   └── DefaultController.php
+        │   └── Kernel.php
+        └── templates
+           └── base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::box`
+
+    .. code-block:: text
+
+        ┃╸ config
+        ┃  ┃╸ packages
+        ┃  ┗╸ routes
+        ┃     ┃╸ framework.yaml
+        ┃     ┗╸ web_profiler.yaml
+        ┃╸ src
+        ┃  ┃╸ Command
+        ┃  ┃╸ Controller
+        ┃  ┃  ┗╸ DefaultController.php
+        ┃  ┗╸ Kernel.php
+        ┗╸ templates
+           ┗╸ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::doubleBox`
+
+    .. code-block:: text
+
+        ╠═ config
+        ║  ╠═ packages
+        ║  ╚═ routes
+        ║    ╠═ framework.yaml
+        ║    ╚═ web_profiler.yaml
+        ╠═ src
+        ║  ╠═ Command
+        ║  ╠═ Controller
+        ║  ║  ╚═ DefaultController.php
+        ║  ╚═ Kernel.php
+        ╚═ templates
+          ╚═ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::compact`
+
+    .. code-block:: text
+
+        ├ config
+        │ ├ packages
+        │ └ routes
+        │   ├ framework.yaml
+        │   └ web_profiler.yaml
+        ├ src
+        │ ├ Command
+        │ ├ Controller
+        │ │ └ DefaultController.php
+        │ └ Kernel.php
+        └ templates
+          └ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::light`
+
+    .. code-block:: text
+
+        |-- config
+        |   |-- packages
+        |   `-- routes
+        |       |-- framework.yaml
+        |       `-- web_profiler.yaml
+        |-- src
+        |   |-- Command
+        |   |-- Controller
+        |   |   `-- DefaultController.php
+        |   `-- Kernel.php
+        `-- templates
+            `-- base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::minimal`
+
+    .. code-block:: text
+
+        . config
+        . . packages
+        . . routes
+        .   . framework.yaml
+        .   . web_profiler.yaml
+        . src
+        . . Command
+        . . Controller
+        . . . DefaultController.php
+        . . Kernel.php
+        . templates
+          . base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::rounded`
+
+    .. code-block:: text
+
+        ├─ config
+        │  ├─ packages
+        │  ╰─ routes
+        │     ├─ framework.yaml
+        │     ╰─ web_profiler.yaml
+        ├─ src
+        │  ├─ Command
+        │  ├─ Controller
+        │  │  ╰─ DefaultController.php
+        │  ╰─ Kernel.php
+        ╰─ templates
+           ╰─ base.html.twig
+
+Making a Custom Tree Style
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can create your own tree style by passing the characters to the constructor
+of the :class:`Symfony\\Component\\Console\\Helper\\TreeStyle` class::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+    use Symfony\Component\Console\Helper\TreeStyle;
+
+    $customStyle = new TreeStyle('🟣 ', '🟠 ', '🔵 ', '🟢 ', '🔴 ', '🟡 ');
+
+    // Pass the custom style to the createTree method
+
+    $tree = TreeHelper::createTree($io, null, [
+        'src' =>  [
+            'Command',
+            'Controller' => [
+                'DefaultController.php',
+            ],
+            'Kernel.php',
+        ],
+        'templates' => [
+            'base.html.twig',
+        ],
+    ], $customStyle);
+
+    $tree->render();
+
+The above code will output the following tree:
+
+.. code-block:: text
+
+    🔵 🟣 🟡 src
+    🔵 🟢 🟣 🟡 Command
+    🔵 🟢 🟣 🟡 Controller
+    🔵 🟢 🟢 🟠 🟡 DefaultController.php
+    🔵 🟢 🟠 🟡 Kernel.php
+    🔵 🟠 🟡 templates
+    🔵 🔴 🟠 🟡 base.html.twig
path: components/console/helpers/tree.rst
user: login: smnandre
body: The whole page is about the new tree helper, should i put the versionadded at the very start of the page ?
created_at: 2025-03-21T09:47:32Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,233 @@
+Tree Helper
+===========
+
+The Tree Helper allows you to build and display tree structures in the console.
+
+Rendering a Tree
+----------------
+
+The :method:`Symfony\\Component\\Console\\Helper\\TreeHelper::createTree` method creates a tree structure from an array and returns a :class:`Symfony\\Component\\Console\\Helper\\Tree`
+object that can be rendered in the console.
+
+Building a Tree from an Array
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can build a tree from an array by passing the array to the :method:`Symfony\\Component\\Console\\Helper\\TreeHelper::createTree`
+method::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+
+    $tree = TreeHelper::createTree($io, null, [
+        'src' =>  [
+            'Command',
+            'Controller' => [
+                'DefaultController.php',
+            ],
+            'Kernel.php',
+        ],
+        'templates' => [
+            'base.html.twig',
+        ],
+    ]);
+
+    $tree->render();
+
+The above code will output the following tree:
+
+.. code-block:: text
+
+    ├── src
+    │   ├── Command
+    │   ├── Controller
+    │   │   └── DefaultController.php
+    │   └── Kernel.php
+    └── templates
+        └── base.html.twig
+
+Manually Creating a Tree
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can manually create a tree by creating a new instance of the :class:`Symfony\\Component\\Console\\Helper\\Tree` class and adding nodes to it::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+    use Symfony\Component\Console\Helper\TreeNode;
+
+    $node = TreeNode::fromValues([
+        'Command',
+        'Controller' => [
+            'DefaultController.php',
+        ],
+        'Kernel.php',
+    ]);
+    $node->addChild('templates');
+    $node->addChild('tests');
+
+    $tree = TreeHelper::createTree($io, $node);
+    $tree->render();
+
+Customizing the Tree Style
+--------------------------
+
+Built-in Tree Styles
+~~~~~~~~~~~~~~~~~~~~
+
+The tree helper provides a few built-in styles that you can use to customize the output of the tree.
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::default`
+
+    .. code-block:: text
+
+        ├── config
+        │   ├── packages
+        │   └── routes
+        │      ├── framework.yaml
+        │      └── web_profiler.yaml
+        ├── src
+        │   ├── Command
+        │   ├── Controller
+        │   │   └── DefaultController.php
+        │   └── Kernel.php
+        └── templates
+           └── base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::box`
+
+    .. code-block:: text
+
+        ┃╸ config
+        ┃  ┃╸ packages
+        ┃  ┗╸ routes
+        ┃     ┃╸ framework.yaml
+        ┃     ┗╸ web_profiler.yaml
+        ┃╸ src
+        ┃  ┃╸ Command
+        ┃  ┃╸ Controller
+        ┃  ┃  ┗╸ DefaultController.php
+        ┃  ┗╸ Kernel.php
+        ┗╸ templates
+           ┗╸ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::doubleBox`
+
+    .. code-block:: text
+
+        ╠═ config
+        ║  ╠═ packages
+        ║  ╚═ routes
+        ║    ╠═ framework.yaml
+        ║    ╚═ web_profiler.yaml
+        ╠═ src
+        ║  ╠═ Command
+        ║  ╠═ Controller
+        ║  ║  ╚═ DefaultController.php
+        ║  ╚═ Kernel.php
+        ╚═ templates
+          ╚═ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::compact`
+
+    .. code-block:: text
+
+        ├ config
+        │ ├ packages
+        │ └ routes
+        │   ├ framework.yaml
+        │   └ web_profiler.yaml
+        ├ src
+        │ ├ Command
+        │ ├ Controller
+        │ │ └ DefaultController.php
+        │ └ Kernel.php
+        └ templates
+          └ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::light`
+
+    .. code-block:: text
+
+        |-- config
+        |   |-- packages
+        |   `-- routes
+        |       |-- framework.yaml
+        |       `-- web_profiler.yaml
+        |-- src
+        |   |-- Command
+        |   |-- Controller
+        |   |   `-- DefaultController.php
+        |   `-- Kernel.php
+        `-- templates
+            `-- base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::minimal`
+
+    .. code-block:: text
+
+        . config
+        . . packages
+        . . routes
+        .   . framework.yaml
+        .   . web_profiler.yaml
+        . src
+        . . Command
+        . . Controller
+        . . . DefaultController.php
+        . . Kernel.php
+        . templates
+          . base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::rounded`
+
+    .. code-block:: text
+
+        ├─ config
+        │  ├─ packages
+        │  ╰─ routes
+        │     ├─ framework.yaml
+        │     ╰─ web_profiler.yaml
+        ├─ src
+        │  ├─ Command
+        │  ├─ Controller
+        │  │  ╰─ DefaultController.php
+        │  ╰─ Kernel.php
+        ╰─ templates
+           ╰─ base.html.twig
+
+Making a Custom Tree Style
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can create your own tree style by passing the characters to the constructor
+of the :class:`Symfony\\Component\\Console\\Helper\\TreeStyle` class::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+    use Symfony\Component\Console\Helper\TreeStyle;
+
+    $customStyle = new TreeStyle('🟣 ', '🟠 ', '🔵 ', '🟢 ', '🔴 ', '🟡 ');
+
+    // Pass the custom style to the createTree method
+
+    $tree = TreeHelper::createTree($io, null, [
+        'src' =>  [
+            'Command',
+            'Controller' => [
+                'DefaultController.php',
+            ],
+            'Kernel.php',
+        ],
+        'templates' => [
+            'base.html.twig',
+        ],
+    ], $customStyle);
+
+    $tree->render();
+
+The above code will output the following tree:
+
+.. code-block:: text
+
+    🔵 🟣 🟡 src
+    🔵 🟢 🟣 🟡 Command
+    🔵 🟢 🟣 🟡 Controller
+    🔵 🟢 🟢 🟠 🟡 DefaultController.php
+    🔵 🟢 🟠 🟡 Kernel.php
+    🔵 🟠 🟡 templates
+    🔵 🔴 🟠 🟡 base.html.twig
path: components/console/helpers/tree.rst
user: login: alamirault
body: I think yes, and add it also in `console/style.rst` after the new methods
created_at: 2025-03-21T10:37:41Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,233 @@
+Tree Helper
+===========
+
+The Tree Helper allows you to build and display tree structures in the console.
+
+Rendering a Tree
+----------------
+
+The :method:`Symfony\\Component\\Console\\Helper\\TreeHelper::createTree` method creates a tree structure from an array and returns a :class:`Symfony\\Component\\Console\\Helper\\Tree`
+object that can be rendered in the console.
+
+Building a Tree from an Array
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can build a tree from an array by passing the array to the :method:`Symfony\\Component\\Console\\Helper\\TreeHelper::createTree`
+method::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+
+    $tree = TreeHelper::createTree($io, null, [
+        'src' =>  [
+            'Command',
+            'Controller' => [
+                'DefaultController.php',
+            ],
+            'Kernel.php',
+        ],
+        'templates' => [
+            'base.html.twig',
+        ],
+    ]);
+
+    $tree->render();
+
+The above code will output the following tree:
+
+.. code-block:: text
+
+    ├── src
+    │   ├── Command
+    │   ├── Controller
+    │   │   └── DefaultController.php
+    │   └── Kernel.php
+    └── templates
+        └── base.html.twig
+
+Manually Creating a Tree
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can manually create a tree by creating a new instance of the :class:`Symfony\\Component\\Console\\Helper\\Tree` class and adding nodes to it::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+    use Symfony\Component\Console\Helper\TreeNode;
+
+    $node = TreeNode::fromValues([
+        'Command',
+        'Controller' => [
+            'DefaultController.php',
+        ],
+        'Kernel.php',
+    ]);
+    $node->addChild('templates');
+    $node->addChild('tests');
+
+    $tree = TreeHelper::createTree($io, $node);
+    $tree->render();
+
+Customizing the Tree Style
+--------------------------
+
+Built-in Tree Styles
+~~~~~~~~~~~~~~~~~~~~
+
+The tree helper provides a few built-in styles that you can use to customize the output of the tree.
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::default`
+
+    .. code-block:: text
+
+        ├── config
+        │   ├── packages
+        │   └── routes
+        │      ├── framework.yaml
+        │      └── web_profiler.yaml
+        ├── src
+        │   ├── Command
+        │   ├── Controller
+        │   │   └── DefaultController.php
+        │   └── Kernel.php
+        └── templates
+           └── base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::box`
+
+    .. code-block:: text
+
+        ┃╸ config
+        ┃  ┃╸ packages
+        ┃  ┗╸ routes
+        ┃     ┃╸ framework.yaml
+        ┃     ┗╸ web_profiler.yaml
+        ┃╸ src
+        ┃  ┃╸ Command
+        ┃  ┃╸ Controller
+        ┃  ┃  ┗╸ DefaultController.php
+        ┃  ┗╸ Kernel.php
+        ┗╸ templates
+           ┗╸ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::doubleBox`
+
+    .. code-block:: text
+
+        ╠═ config
+        ║  ╠═ packages
+        ║  ╚═ routes
+        ║    ╠═ framework.yaml
+        ║    ╚═ web_profiler.yaml
+        ╠═ src
+        ║  ╠═ Command
+        ║  ╠═ Controller
+        ║  ║  ╚═ DefaultController.php
+        ║  ╚═ Kernel.php
+        ╚═ templates
+          ╚═ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::compact`
+
+    .. code-block:: text
+
+        ├ config
+        │ ├ packages
+        │ └ routes
+        │   ├ framework.yaml
+        │   └ web_profiler.yaml
+        ├ src
+        │ ├ Command
+        │ ├ Controller
+        │ │ └ DefaultController.php
+        │ └ Kernel.php
+        └ templates
+          └ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::light`
+
+    .. code-block:: text
+
+        |-- config
+        |   |-- packages
+        |   `-- routes
+        |       |-- framework.yaml
+        |       `-- web_profiler.yaml
+        |-- src
+        |   |-- Command
+        |   |-- Controller
+        |   |   `-- DefaultController.php
+        |   `-- Kernel.php
+        `-- templates
+            `-- base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::minimal`
+
+    .. code-block:: text
+
+        . config
+        . . packages
+        . . routes
+        .   . framework.yaml
+        .   . web_profiler.yaml
+        . src
+        . . Command
+        . . Controller
+        . . . DefaultController.php
+        . . Kernel.php
+        . templates
+          . base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::rounded`
+
+    .. code-block:: text
+
+        ├─ config
+        │  ├─ packages
+        │  ╰─ routes
+        │     ├─ framework.yaml
+        │     ╰─ web_profiler.yaml
+        ├─ src
+        │  ├─ Command
+        │  ├─ Controller
+        │  │  ╰─ DefaultController.php
+        │  ╰─ Kernel.php
+        ╰─ templates
+           ╰─ base.html.twig
+
+Making a Custom Tree Style
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can create your own tree style by passing the characters to the constructor
+of the :class:`Symfony\\Component\\Console\\Helper\\TreeStyle` class::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+    use Symfony\Component\Console\Helper\TreeStyle;
+
+    $customStyle = new TreeStyle('🟣 ', '🟠 ', '🔵 ', '🟢 ', '🔴 ', '🟡 ');
+
+    // Pass the custom style to the createTree method
+
+    $tree = TreeHelper::createTree($io, null, [
+        'src' =>  [
+            'Command',
+            'Controller' => [
+                'DefaultController.php',
+            ],
+            'Kernel.php',
+        ],
+        'templates' => [
+            'base.html.twig',
+        ],
+    ], $customStyle);
+
+    $tree->render();
+
+The above code will output the following tree:
+
+.. code-block:: text
+
+    🔵 🟣 🟡 src
+    🔵 🟢 🟣 🟡 Command
+    🔵 🟢 🟣 🟡 Controller
+    🔵 🟢 🟢 🟠 🟡 DefaultController.php
+    🔵 🟢 🟠 🟡 Kernel.php
+    🔵 🟠 🟡 templates
+    🔵 🔴 🟠 🟡 base.html.twig
path: components/console/helpers/tree.rst
user: login: OskarStark
body: Yes please, so that a reader knows, since when this can be used 
created_at: 2025-03-21T16:41:14Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,233 @@
+Tree Helper
+===========
+
+The Tree Helper allows you to build and display tree structures in the console.
+
+Rendering a Tree
+----------------
+
+The :method:`Symfony\\Component\\Console\\Helper\\TreeHelper::createTree` method creates a tree structure from an array and returns a :class:`Symfony\\Component\\Console\\Helper\\Tree`
+object that can be rendered in the console.
+
+Building a Tree from an Array
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can build a tree from an array by passing the array to the :method:`Symfony\\Component\\Console\\Helper\\TreeHelper::createTree`
+method::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+
+    $tree = TreeHelper::createTree($io, null, [
+        'src' =>  [
+            'Command',
+            'Controller' => [
+                'DefaultController.php',
+            ],
+            'Kernel.php',
+        ],
+        'templates' => [
+            'base.html.twig',
+        ],
+    ]);
+
+    $tree->render();
+
+The above code will output the following tree:
+
+.. code-block:: text
+
+    ├── src
+    │   ├── Command
+    │   ├── Controller
+    │   │   └── DefaultController.php
+    │   └── Kernel.php
+    └── templates
+        └── base.html.twig
+
+Manually Creating a Tree
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can manually create a tree by creating a new instance of the :class:`Symfony\\Component\\Console\\Helper\\Tree` class and adding nodes to it::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+    use Symfony\Component\Console\Helper\TreeNode;
+
+    $node = TreeNode::fromValues([
+        'Command',
+        'Controller' => [
+            'DefaultController.php',
+        ],
+        'Kernel.php',
+    ]);
+    $node->addChild('templates');
+    $node->addChild('tests');
+
+    $tree = TreeHelper::createTree($io, $node);
+    $tree->render();
+
+Customizing the Tree Style
+--------------------------
+
+Built-in Tree Styles
+~~~~~~~~~~~~~~~~~~~~
+
+The tree helper provides a few built-in styles that you can use to customize the output of the tree.
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::default`
+
+    .. code-block:: text
+
+        ├── config
+        │   ├── packages
+        │   └── routes
+        │      ├── framework.yaml
+        │      └── web_profiler.yaml
+        ├── src
+        │   ├── Command
+        │   ├── Controller
+        │   │   └── DefaultController.php
+        │   └── Kernel.php
+        └── templates
+           └── base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::box`
+
+    .. code-block:: text
+
+        ┃╸ config
+        ┃  ┃╸ packages
+        ┃  ┗╸ routes
+        ┃     ┃╸ framework.yaml
+        ┃     ┗╸ web_profiler.yaml
+        ┃╸ src
+        ┃  ┃╸ Command
+        ┃  ┃╸ Controller
+        ┃  ┃  ┗╸ DefaultController.php
+        ┃  ┗╸ Kernel.php
+        ┗╸ templates
+           ┗╸ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::doubleBox`
+
+    .. code-block:: text
+
+        ╠═ config
+        ║  ╠═ packages
+        ║  ╚═ routes
+        ║    ╠═ framework.yaml
+        ║    ╚═ web_profiler.yaml
+        ╠═ src
+        ║  ╠═ Command
+        ║  ╠═ Controller
+        ║  ║  ╚═ DefaultController.php
+        ║  ╚═ Kernel.php
+        ╚═ templates
+          ╚═ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::compact`
+
+    .. code-block:: text
+
+        ├ config
+        │ ├ packages
+        │ └ routes
+        │   ├ framework.yaml
+        │   └ web_profiler.yaml
+        ├ src
+        │ ├ Command
+        │ ├ Controller
+        │ │ └ DefaultController.php
+        │ └ Kernel.php
+        └ templates
+          └ base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::light`
+
+    .. code-block:: text
+
+        |-- config
+        |   |-- packages
+        |   `-- routes
+        |       |-- framework.yaml
+        |       `-- web_profiler.yaml
+        |-- src
+        |   |-- Command
+        |   |-- Controller
+        |   |   `-- DefaultController.php
+        |   `-- Kernel.php
+        `-- templates
+            `-- base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::minimal`
+
+    .. code-block:: text
+
+        . config
+        . . packages
+        . . routes
+        .   . framework.yaml
+        .   . web_profiler.yaml
+        . src
+        . . Command
+        . . Controller
+        . . . DefaultController.php
+        . . Kernel.php
+        . templates
+          . base.html.twig
+
+:method:`Symfony\\Component\\Console\\Helper\\TreeStyle::rounded`
+
+    .. code-block:: text
+
+        ├─ config
+        │  ├─ packages
+        │  ╰─ routes
+        │     ├─ framework.yaml
+        │     ╰─ web_profiler.yaml
+        ├─ src
+        │  ├─ Command
+        │  ├─ Controller
+        │  │  ╰─ DefaultController.php
+        │  ╰─ Kernel.php
+        ╰─ templates
+           ╰─ base.html.twig
+
+Making a Custom Tree Style
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can create your own tree style by passing the characters to the constructor
+of the :class:`Symfony\\Component\\Console\\Helper\\TreeStyle` class::
+
+    use Symfony\Component\Console\Helper\TreeHelper;
+    use Symfony\Component\Console\Helper\TreeStyle;
+
+    $customStyle = new TreeStyle('🟣 ', '🟠 ', '🔵 ', '🟢 ', '🔴 ', '🟡 ');
+
+    // Pass the custom style to the createTree method
+
+    $tree = TreeHelper::createTree($io, null, [
+        'src' =>  [
+            'Command',
+            'Controller' => [
+                'DefaultController.php',
+            ],
+            'Kernel.php',
+        ],
+        'templates' => [
+            'base.html.twig',
+        ],
+    ], $customStyle);
+
+    $tree->render();
+
+The above code will output the following tree:
+
+.. code-block:: text
+
+    🔵 🟣 🟡 src
+    🔵 🟢 🟣 🟡 Command
+    🔵 🟢 🟣 🟡 Controller
+    🔵 🟢 🟢 🟠 🟡 DefaultController.php
+    🔵 🟢 🟠 🟡 Kernel.php
+    🔵 🟠 🟡 templates
+    🔵 🔴 🟠 🟡 base.html.twig
path: components/console/helpers/tree.rst
user: login: smnandre
body: Would this work ? (last changes)
created_at: 2025-03-21T17:25:07Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,237 @@
+Tree Helper
+===========
+
+The Tree Helper allows you to build and display tree structures in the console.
+
+.. versionadded:: 7.3
+
+    The TreeHelper class was introduced in Symfony 7.3.
path: components/console/helpers/tree.rst
user: login: OskarStark
body: ```suggestion
    The ``TreeHelper`` class was introduced in Symfony 7.3.
```
created_at: 2025-03-22T07:29:09Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,237 @@
+Tree Helper
+===========
+
+The Tree Helper allows you to build and display tree structures in the console.
+
+.. versionadded:: 7.3
+
+    The TreeHelper class was introduced in Symfony 7.3.
path: components/console/helpers/tree.rst
user: login: smnandre
body: Thx
created_at: 2025-03-24T03:22:18Z
author_association: MEMBER

PR comments:
user: login: OskarStark
created_at: 2025-03-22T07:30:18Z
body: Link to the code PR is not working in the PR header
author_association: CONTRIBUTOR
user: login: smnandre
created_at: 2025-03-24T03:21:52Z
body: > Link to the code PR is not working in the PR header

Fixed sorry
author_association: MEMBER
user: login: javiereguiluz
created_at: 2025-03-24T08:59:13Z
body: Thanks Simon for contributing this nice feature and for providing such detailed docs for it.

While merging I did some tweaks (see https://github.com/symfony/symfony-docs/commit/a0758ac62303e037fb903ba59fe807fd798f561d):

* Updated the intro to add some examples of when to use this
* Added a full code example of using this inside a console command. This is important because if you copy+paste the examples, it won't work (e.g. the `$io` variable is not defined). I only added this in the first example to avoid boring repetition
* Changed `text` by `terminal` in the code examples to display the rendered output in a terminal-like window.
author_association: MEMBER
user: login: smnandre
created_at: 2025-03-25T04:51:00Z
body: Thank you very much @javiereguiluz !!
author_association: MEMBER