CSS Layout API - Interactive CSS Lab | IconVault
Write Houdini registerLayout() worklets in your browser. Masonry and circular layout presets, live reflow, copyable worklet and CSS.
CSS Layout API
Build custom layout algorithms: masonry, circular
chrome://flags → Experimental Web Platform Features, then register below. The worklet code and CSS are still useful for learning.Layout preset
Fills the shortest column first, like a Pinterest wall.
5 of 5 free uses left. Editing and sliders are unlimited.
Live layout container
Showing plain flexbox until you register. The worklet takes over positioning once registered.
Worklet source (editable)
Keep the LAYOUT_NAME placeholder, it is replaced with a unique layout name on register.
/* Press "Run layout" to register the worklet, then copy the CSS here. */
class Masonry {
static get inputProperties() { return ["--columns"]; }
async intrinsicSizes() {}
async layout(children, edges, constraints, styleMap) {
const columns = Math.max(1, parseInt(styleMap.get("--columns").toString(), 10) || 3);
const width = constraints.fixedInlineSize;
const colWidth = (width - edges.inline) / columns;
const heights = new Array(columns).fill(0);
const childFragments = [];
for (const child of children) {
const frag = await child.layoutNextFragment({ fixedInlineSize: colWidth });
let col = 0;
for (let i = 1; i < columns; i++) {
if (heights[i] < heights[col]) col = i;
}
frag.inlineOffset = edges.inlineStart + col * colWidth;
frag.blockOffset = edges.blockStart + heights[col];
heights[col] += frag.blockSize;
childFragments.push(frag);
}
return { autoBlockSize: Math.max.apply(null, heights), childFragments };
}
}
registerLayout("my-layout", Masonry);About this tool
IconVault's CSS Layout API playground is a hands-on lab for the Houdini Layout API: the experimental browser feature that lets you write your own layout algorithms with registerLayout() and use them via display: layout(name). Start from a working masonry worklet or a circular layout worklet, edit the code, tweak inputs like --columns and --radius, add children, and watch the container reflow with your algorithm in charge.
Everything runs fully in your browser and is free to use. The tool registers your worklet through CSS.layoutWorklet.addModule() for real, and you can copy the worklet JavaScript plus the CSS that applies it. Honest note: the Layout API is still experimental and needs the Experimental Web Platform Features flag in Chrome; the tool says so plainly and the code remains a solid way to learn the API before it ships.
Frequently asked questions
Popular searches
More tools
Algorithm Visualizer
Watch sorting and searching animate step by step
Alt Text Helper
Write better image alt text with live feedback
ARIA Reference
Searchable ARIA roles and attributes guide
Array Visualizer
Step through map, filter, reduce like a debugger
Coming soon
CLI
Coming soon
Figma plugin
Coming soon
VS Code extension
Coming soon
Chrome extension
Coming soon
AI icon generator
Coming soon
Team workspaces
Coming soon