Flexbox & Grid Playground

Drag presets, watch the layout, grab the CSS or Tailwind.

Free CSS Flexbox & Grid generator: drag presets, see the layout update live, copy ready-made CSS or Tailwind. Compare flexbox vs grid in-browser, no login.

About Flexbox & Grid Playground

The Flexbox & Grid Playground is a free, browser-based visual editor for CSS Flexbox and Grid layouts that updates a live preview as you adjust properties and gives you copy-ready CSS or Tailwind classes. Switch between Flexbox and Grid modes, tweak controls like flex-direction, justify-content, align-items, columns, rows, and gap, then copy the generated `.container {…}` rule or Tailwind utility string. It runs entirely in your browser with nothing uploaded and no signup, so it is handy when you want to learn how a property behaves or grab working layout code without writing it by hand.

How to use Flexbox & Grid Playground

  1. Use the Flexbox / Grid toggle at the top to choose which layout system you want to experiment with.
  2. Set the number of preview boxes with the - and + buttons next to 'Items' (1 to 12 colored blocks).
  3. Click a preset button (e.g. 'Center everything', 'Holy grail', 'Card gallery') to jump-start a common layout, or skip straight to the controls.
  4. Adjust the dropdowns and sliders — flex-direction, justify-content, align-items, flex-wrap, and gap for Flexbox; columns, rows, gap, justify-items, align-items, and grid-template-columns for Grid — and watch the live preview update.
  5. In Grid mode, optionally type a custom grid-template-columns value (like 1fr 2fr 1fr) or pick from the preset templates dropdown; a non-blocking warning appears if the value looks malformed.
  6. Switch the output between CSS and Tailwind with the segmented toggle, then click the Copy button to grab the generated code.

Frequently asked questions

Is any data uploaded to a server?
No. The playground generates CSS and Tailwind entirely in your browser — there are no files involved and nothing is uploaded. It is a client-side code generator that only outputs text.
Is it free and do I need an account?
Yes, it's completely free with no signup, account, or watermark.
Can I export Tailwind classes instead of plain CSS?
Yes. Use the CSS / Tailwind toggle in the output panel to switch formats — Tailwind mode produces utility strings like 'flex flex-row justify-center items-center gap-[12px]', and arbitrary values such as gap or a custom grid template are emitted as bracket utilities.
Can I define a custom grid layout instead of just equal columns?
Yes. In Grid mode the grid-template-columns field accepts free-form values like '240px 1fr' or 'repeat(auto-fit, minmax(180px, 1fr))', and there is a preset-templates dropdown for common patterns. A typed template overrides the columns slider, and a non-blocking warning flags obviously invalid values (for example commas between tracks instead of spaces).
How many preview items can I show, and do my settings persist?
You can show between 1 and 12 preview boxes using the - and + buttons. Your mode, output format, item count, and all Flexbox/Grid settings are saved in your browser's local storage, so they're still there when you return.
Does it generate styles for the child items too?
No. The tool outputs a single container rule — display, the alignment properties, and gap — for the parent. The colored preview boxes only demonstrate how container-level Flexbox or Grid properties affect their children; per-item properties like flex-grow or grid-column aren't generated.

People also search for

Flexbox & Grid Playground is also known as flexbox grid css, flexbox grid generator, flexbox grid layout, css grid playground, flexbox vs grid, flexbox grid examples, flexbox to tailwind.