Back to Material

Layout Container.Tmpl

docs/app/partials/layout-container.tmpl.html

1.2.52.1 KB
Original Source

Layout and Containers

Use the layout directive on a container element to specify the layout direction for its children: horizontally in a row (layout="row") or vertically in a column (layout="column"). Note that row is the default layout direction if you specify the layout directive without a value.

| row | Items arranged horizontally. max-height = 100% and max-width is the width of the items in the container. | | column | Items arranged vertically. max-width = 100% and max-height is the height of the items in the container. |

First item in row

Second item in row

First item in column

Second item in column

Note that layout only affects the flow direction for that container's immediate children.


Layouts and Responsive Breakpoints

As discussed in the Layout Introduction page you can make your layout change depending upon the device view size by using breakpoint alias suffixes.

To make your layout automatically change depending upon the device screen size, use one to the following layout APIs to set the layout direction for devices with view widths:

APIDevice width when breakpoint overrides default
layoutSets default layout direction unless overridden by another breakpoint.
layout-xswidth < 600 px
layout-gt-xswidth >= 600 px
layout-sm600 px <= width < 960 px
layout-gt-smwidth >= 960 px
layout-md960 px <= width < 1280 px
layout-gt-mdwidth >= 1280 px
layout-lg1280 px <= width < 1920 px
layout-gt-lgwidth >= 1920 px
layout-xlwidth >= 1920 px

For the demo below, as you shrink your browser window width notice the flow direction changes to column for mobile devices (xs). And as you expand it will reset to row for gt-sm view sizes.

I'm above on mobile, and to the left on larger devices.

I'm below on mobile, and to the right on larger devices.

See the Layout Options page for more options such as padding, alignments, etc.