Skip to content

TreeNode ​

Collapsible tree node with instant expansion.

TreeNode

Design lines ​

src
vue
1<Tabs defaultValue="tuix">2  <TabsList>3    <Tab value="tuix">TUIX</Tab>4    <Tab value="rubik">Rubik</Tab>5  </TabsList>6  <TabPanel value="tuix">7    <TreeNode design="tuix"><template #label>src</template>index.ts</TreeNode>8  </TabPanel>9  <TabPanel value="rubik">10    <TreeNode design="rubik"><template #label>src</template>index.ts</TreeNode>11  </TabPanel>12</Tabs>

Demo ​

Basic (label + slots) ​

Nests TreeNode children using the label slot for each node name.

src
vue
1<TreeNode>2  <template #label>src</template>3  <TreeNode>4    <template #label>components</template>5    <TreeNode><template #label>Panel.vue</template></TreeNode>6    <TreeNode><template #label>Badge.vue</template></TreeNode>7  </TreeNode>8  <TreeNode>9    <template #label>composables</template>10    <TreeNode><template #label>useToast.ts</template></TreeNode>11  </TreeNode>12</TreeNode>

Label (label) ​

Plain-text label content via the label prop. The slot wins if both are provided.

src
vue
1<TreeNode label="src">2  <TreeNode label="components">3    <TreeNode label="Panel.vue" />4  </TreeNode>5</TreeNode>

Slots ​

label ​

Content of the node (text or HTML).

default ​

Nested child nodes (other TreeNode).

API ​

SlotDescription
labelNode content (text or HTML)
defaultChild nodes (other TreeNode)

Props ​

label ​

Plain-text label content shown in the row. Overridden by the label slot if provided.

TypeDefaultRequired
string—❌

design ​

Design line (or inherit from data-design).

TypeDefaultRequired
'tuix' | 'rubik'— (inherits from data-design)❌

CSS Custom Properties ​

TokenDefaultDescription
--font-mono"JetBrains Mono", ui-monospace, monospaceMonospace font stack for code-like content (key labels, log lines, chips).
--accentfrom theme (--ctp-latte-mauve / --ctp-mocha-mauve)Accent color, mapped from the active semantic color.
--bg-altfrom theme (--ctp-latte-mantle / --ctp-mocha-mantle)Alternate background (the next layer down from the base).
--textfrom theme (--ctp-latte-text / --ctp-mocha-text)Primary text color used inside the component.
--text-mutedfrom theme (--ctp-latte-subtext1 / --ctp-mocha-subtext1)Secondary text for hints, annotations and disabled state.

Ver Theming para la convención completa.