Skip to content
Style mixins for cross-platform flex-box layouts
HTML JavaScript
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Update `.github/CODEOWNERS` Aug 23, 2018
demo fix demo Jul 11, 2018
test remove refs to polymer.element Jul 24, 2018
.gitignore Tedium automated v3 element updates. Aug 16, 2018
.npmignore Tedium automated v3 element updates. Aug 16, 2018
.travis.yml Only generate types once on Travis Sep 7, 2018 workaround root/html issue Aug 24, 2016 fix readme Jul 11, 2018
bower.json Add `bower.json` so that can read the repo. Sep 14, 2018
formatconfig.json Fix formatconfig.json Aug 8, 2018
iron-flex-layout-classes.js fix readme Jul 11, 2018
iron-flex-layout.js Add @override, remove @attribute/@group/@hero/@homepage (#149) Jun 19, 2019
package-lock.json 3.0.1 Sep 14, 2018
wct.conf.json Automatic cleanup! (#143) Jun 7, 2018

Published on NPM Build status Published on


The <iron-flex-layout> component provides simple ways to use CSS flexible box layout, also known as flexbox. Note that this is an old element, that was written before all modern browsers had non-prefixed flex styles. As such, nowadays you don't really need to use this element anymore, and can use CSS flex styles directly in your code.

See: Documentation, Demo.

This component provides two different ways to use flexbox:

  1. Layout classes. The layout class stylesheet provides a simple set of class-based flexbox rules, that let you specify layout properties directly in markup. You must include this file in every element that needs to use them.

  2. Custom CSS mixins. The mixin stylesheet includes custom CSS mixins that can be applied inside a CSS rule using the @apply function.



npm install --save @polymer/iron-flex-layout

In a Polymer 3 element

import {PolymerElement, html} from '@polymer/polymer';
import '@polymer/iron-flex-layout/iron-flex-layout-classes.js';

class SampleElement extends PolymerElement {
  static get template() {
    return html`
      <style is="custom-style" include="iron-flex iron-flex-alignment"></style>
        .test { width: 100px; }
      <div class="layout horizontal center-center">
        <div class="test">horizontal layout center alignment</div>
customElements.define('sample-element', SampleElement);


If you want to send a PR to this element, here are the instructions for running the tests and demo locally:


git clone
cd iron-flex-layout
npm install
npm install -g polymer-cli

Running the demo locally

polymer serve --npm

Running the tests

polymer test --npm
You can’t perform that action at this time.