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.

All tools

CSS Layout API

Build custom layout algorithms: masonry, circular

5 of 5 free uses left
unknownHonest note: the Layout API is still experimental. In Chrome, enable 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

1
2
3
4
5
6
7
8
9

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.

CSS to use it
/* Press "Run layout" to register the worklet, then copy the CSS here. */
Worklet (registerLayout call)
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

css layout apihoudini layout apiregisterlayoutcss layout workletdisplay layout csscss houdini layout tutorialcustom css layout algorithmmasonry layout workletcss masonry without javascript librarylayoutworklet addmodulecss layout api browser supportcss layout api chrome flagexperimental web platform features layout apiregisterlayout examplehoudini layout worklet examplecss custom layout enginewrite your own css layoutlayoutnextfragment examplecss layout api demohoudini layout api democircular layout csscss layout api vs gridcss layout api vs flexboxwhat is css houdini layout apihoudini apis explainedcss layout worklet not workingcss.layoutworklet undefinedlayout worklet typescriptregisterlayout typescriptintrinsicSizes layout workletchild layoutnextfragmentcss layout api 2026learn css layout apiinteractive css layout playgroundcss layout worklet buildermasonry css native 2026native css masonrycss grid masonrypinterest layout css workletcustom layout css houdinidisplay layout my layoutcss layout api playgroundhoudini registerlayout tutoriallayout worklet input propertiesstylemap layout workletcss fragmentation layout apiautoBlockSize layout workletcss layout worklet generatorexperimental css layout featuresfuture of css layout

More tools

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

View all 10+ tools →