Skip to content

Trees

A hierarchy defined by indentation.

A hierarchy defined by indentation. dir is the way it grows: down (the default) reads as an outline, right puts each level in its own column, and split balances branches either side of a centre — prefix a branch with > or < to pin its side. nodes=boxed draws every node as a pill. Put a \n anywhere a label should break; the node gets taller by a row and a line still meets it at the middle of its first one.

A block written inside it is drawn below it. What goes inside what

@tree dir=right
  Table
    Cell
      Content type
      Interaction
    Row
      Actions
    Column
      Width
  • Table
    • Cell
      • Content type
      • Interaction
    • Row
      • Actions
    • Column
      • Width
Settings
SettingTypeRequiredDefaultMeaning
dirdown · right · splitnodownThe way the tree grows. down grows down the page — an outline, or with nodes=boxed a top-down chart. right gives each level its own column, aligned so a level reads straight down. split places branches either side of a centre, balanced by size.
stylesolid · dashed · roundednosolidLine style between nodes.
nodestext · boxednotextHow each node is drawn. text sets the labels on the page, joined by thin lines — quiet enough to sit inside prose. boxed draws every node as a pill, branches darker than leaves, with arrows from parent to child — an infographic that carries more weight.
More examples
@tree(dir=down nodes=boxed)
  Discovery
    Interviews
      Recruiting
      Synthesis
    Survey
      Design
      Analysis
  • Discovery
    • Interviews
      • Recruiting
      • Synthesis
    • Survey
      • Design
      • Analysis
@tree
  Orders
    Customer
      Segment
    Product
  • Orders
    • Customer
      • Segment
    • Product
@tree(dir=right nodes=boxed)
  Discovery
    Interviews
      Synthesis
    Survey
  • Discovery
    • Interviews
      • Synthesis
    • Survey
@tree dir=split
  Central idea
    > Pillar A
      > Sub-point
    < Pillar B
  • Pillar B
Central idea
  • Pillar A
    • Sub-point
@tree(dir=split nodes=boxed)
  Retention
    > Onboarding
      > First value
    < Habit loop
  • Habit loop
Retention
  • Onboarding
    • First value