components

Tailwind CSS Tree View

Use Tree View to navigate hierarchical data, making it perfect for directories, hierarchies, and more. Effortlessly expand, collapse, and select tree nodes.

Class Name
Type
Description
accordion-treeview-rootComponentServe as the primary container wrapper.
accordion-selectableComponentwrapper for content
accordion-headingComponentContainer class specifically for child elements within accordion-item.
accordion-selectableComponentContainer component serving as a wrapper for content, particularly selectable content..
accordion-selected:{tw-utility-class}ModifierModifier applying Tailwind utility styles.
tree-view-spaceModifierStyle space and border for sub-menu.

Example of a basic Tree View to expand and collapse tree view nodes. You can change icon, text as per your needs.

Remove the data-accordion-always-open attribute to close the currently open element at the group level.