Skip to content
epitometool

Flexbox playground

CSS & UI generators

Experiment with flex direction, alignment, wrap and gap, then copy valid CSS output.

Updated

Flex controls

Preview

1
2
3
4
5
6

CSS output

display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 12px;

Quick start

How to use flexbox playground

Tune core flex properties and watch immediate layout behavior.

  1. Step 1
    Set flex properties

    Pick direction, justify, align, wrap and gap values.

  2. Step 2
    Watch preview

    Observe how item layout reacts in real time.

  3. Step 3
    Copy CSS

    Paste the generated flex declarations into your project.

In-depth guide

Flexbox playground

Experiment with core flexbox properties and understand layout behavior instantly through a live preview.

Main axis vs cross axis

justify-content aligns items on the main axis. align-items aligns them on the cross axis.

Common real-world patterns

  • Navbar: row + space-between + center.
  • Vertical stack: column + flex-start + stretch.
  • Tag chips: row + wrap + gap.

How to use it

  1. Toggle flex-direction to choose a row or column layout.
  2. Adjust justify-content and align-items to position items along each axis, and enable flex-wrap for multi-line layouts.
  3. Copy the generated container CSS once the preview matches your design.

Remember that gap now works in flexbox, so you rarely need margins between items anymore.

Pitfalls and privacy

The classic confusion is which axis a property affects: in a column layout justify-content controls vertical placement and align-items controls horizontal. Items shrink below their content by default — add min-width: 0 to a flex child if long text refuses to wrap. Flexbox is one-dimensional; reach for CSS Grid when you need real rows and columns. Everything runs locally in your browser with no upload.

When to use it vs alternatives

Use this tool for quick browser-based work when you need an answer or output immediately. Use a dedicated application or automated workflow when you need bulk processing, approvals, or repeatable production rules.

Frequently asked questions

What does flex-wrap do?

It controls whether items stay on one line or move to the next line when space runs out.

Why does align-items feel different in row vs column?

It always aligns across the cross-axis, and the cross-axis changes when flex-direction changes.

Can I copy Tailwind classes too?

This version outputs raw CSS. Tailwind class output can be added in Sprint 2.

When should I use flexbox instead of grid?

Use flexbox for one-dimensional layouts like a row of buttons or a navbar. Use CSS Grid when you need to align content in both rows and columns at once.

How do I add space between items?

Use the gap property on the flex container. It works in all modern browsers and avoids fiddly margins on each child.

Why does my flex item not shrink?

By default items will not shrink below their content size. Add min-width: 0 to the child so long content can compress and wrap.

Keep exploring

More tools you'll like

Hand-picked utilities that pair well with the one you're on — all free, client-side, and zero-signup.