When to use it. Hierarchy as space: squarified rectangles sized by value — disk usage, budget splits, portfolio weights. The hidden edge is drill-down: tap an item with children and the map zooms into it (a back chip replaces the label, Files-app style); tap a leaf and itemAction fires with the item and its drill path, so a storage map doubles as a category picker.
Type
treemap
Also titled
Treemap
Default size
3 rows × 4 columns
Symbol
rectangle.3.group.fill
Docs
Docs complete
Search for it as
tree map
hierarchy
blocks
size
disk usage
proportion
Rendered by the app
Fields
13 fields you can set on a treemap control. Every control also takes the shared fields (id, position, span, sync, action).
Fields
Field
Type
Default
What it does
haptichaptic
choiceone of 10
—
Buzz when you tap
Plays this touch feedback when a cell is tapped; leave it empty for a light tap.
noneno feedback
lighta gentle tap
mediuma medium tap
heavya strong tap
softa cushioned tap
rigida sharp tap
selectiona tiny tick like scrolling a picker
successa confirming pattern
warninga cautioning pattern
errora sharp error pattern
Titlelabel
text
—
The title above the blocks
Shows this text as the header, which becomes a back button while you are zoomed into a group.
treemapConfigtreemapConfig
object
—
Extra block settings
Holds the optional look and behavior settings for the blocks.
Colortint
color
#667eea
The main block color
Colors the first block and seeds the colors of the rest.
formatValueformatValue
text
—
How numbers are written
Formats the values shown on blocks, for example with a unit after the number.
Cell roundnesstreemapConfig.cellCornerRadius
number0–30 ptstep 1
5
How round the blocks are
Rounds each block's corners from square to 30 points.
Cell spacingtreemapConfig.cellGap
number0–40 ptstep 1
2
The space between blocks
Leaves this many points of gap between neighboring blocks.
Cell colorstreemapConfig.colors
string[]
—
Colors for the blocks
Gives blocks colors from this list in turn; a color set on an item wins.
drillDowntreemapConfig.drillDown
on / off
true(on)
Tap a group to open it
When on, tapping a block with items inside zooms into it; when off, every tap acts as a pick.
itemActiontreemapConfig.itemAction
object
—
What happens when you pick a block
Runs this action when you tap a block with nothing inside, passing its label, value and path.
scrubtreemapConfig.scrub
on / off
false(off)
Slide a finger across the blocks
When on, dragging highlights the block under your finger with a live readout, and only a tap drills in or acts.
LabelstreemapConfig.showLabels
on / off
true(on)
Names on the blocks
Draws each block's name inside it where there is room.
Value labelstreemapConfig.showValues
on / off
false(off)
Numbers on the blocks
Draws each block's value under its name on blocks tall enough to fit.
Theme fields
Restyle one control by setting these in its theme object; a layout's theme sets them for every control.
Theme fields
Field
Type
Default
What it does
secondaryColortheme.secondaryColor
color
#FFFFFF99
Space inside the edge
Colors the block names and header text.
Emits and receives
What this control sends when you use it, and what it can show or follow when data arrives.
Emits
Emits
Sends
When
Type
What it sends
When you tap a blockitem
tap
json
the tapped block, as JSON with its label, size and path
A block with items inside opens instead when drill down is on, and sends nothing
Sets your own block colors and lets a drag glide across cells. Intended effect: sliding a finger highlights each block with its value, without zooming in.
Fired on leaf tap; {{value}} = {"label", "value", "path"}
scrub
bool
false
Drag highlights the cell under the finger with a live readout (no drilling/actions until a tap)
Sync Payload Structure
A tree of weighted items — natural JSON or an encoded string. A bare array is
shorthand for {"items": …}. A parent's value defaults to the sum of its
children: