Treemap Split
A treemap splits into category tiles, the biggest tile in gradient with a 38% label. A free, MIT-licensed Remotion number animation.
$ pnpm dlx shadcn@latest add @remocn/treemap-splitUsage
// src/Root.tsx
import { Composition } from "remotion";
import { TreemapSplit } from "@/components/remocn/treemap-split";
const TreemapSplitScene = () => (
<TreemapSplit
items={[
{ label: "Captions", value: 38 },
{ label: "Transitions", value: 16 },
{ label: "Text", value: 12 },
{ label: "Shaders", value: 8 },
{ label: "Icons", value: 6 },
]}
/>
);
export const RemotionRoot = () => (
<Composition
id="TreemapSplit"
component={TreemapSplitScene}
durationInFrames={350}
fps={60}
width={1280}
height={720}
/>
);A rectangle splits recursively with drawn lines into category tiles, then the highlighted tile fills with gradient, the rest dim, and its share counts up with its label. Pass items (label and value, up to ten) and optionally highlight, the index of the hero item; it defaults to the largest. Ships dark and light via theme.
Props13
| Prop | Type | Default |
|---|---|---|
| items | TreemapItem[]DEFAULT_ITEMS Up to ten categories; tile area follows value. | |
| highlight | number— Index in items of the hero tile; defaults to the largest. | |
| fontFamily | string"Schibsted Grotesk" Typeface for the copy. Load the font in your project first. | |
| split | number22 Frames each split takes to draw its line and open. | |
| radius | number6 Corner radius of the cells, in px at 720p. | |
| accent | string"#3B5BFD" Accent color for the hero element. | |
| ink | string— Text color; overrides the theme ink. | |
| background | string— Background fill; pass "transparent" to drop it. | |
| grain | booleantrue Film grain over the scene. | |
| scale | number1 Size of the foreground around the frame's center; the background stays put. | |
| delay | number0 Frames to hold the first frame before anything moves. | |
| theme | "dark" | "light""dark" Dark or light palette. | |
| speed | number1 Playback multiplier. | |
- itemsTreemapItem[]
Up to ten categories; tile area follows value.
Default
DEFAULT_ITEMS - highlightnumber
Index in items of the hero tile; defaults to the largest.
- fontFamilystring
Typeface for the copy. Load the font in your project first.
Default
"Schibsted Grotesk" - splitnumber
Frames each split takes to draw its line and open.
Default
22 - radiusnumber
Corner radius of the cells, in px at 720p.
Default
6 - accentstring
Accent color for the hero element.
Default
"#3B5BFD" - inkstring
Text color; overrides the theme ink.
- backgroundstring
Background fill; pass "transparent" to drop it.
- grainboolean
Film grain over the scene.
Default
true - scalenumber
Size of the foreground around the frame's center; the background stays put.
Default
1 - delaynumber
Frames to hold the first frame before anything moves.
Default
0 - theme"dark" | "light"
Dark or light palette.
Default
"dark" - speednumber
Playback multiplier.
Default
1