Back to Material

Layout Options.Tmpl

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

1.2.52.6 KB
Original Source

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 Container Elements page for a basic explanation of layout directives.
To make your layout change depending upon the device screen size, there are other layout directives available:

APIActivates when device
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

Layout Margin, Padding, Wrap and Fill

Parent layout and this element have margins.

Parent layout and this element have padding.

Parent layout is set to fill available space.

I am using all three at once.

layout-margin adds margin around each flex child. It also adds a margin to the layout container itself.
layout-padding adds padding inside each flex child. It also adds padding to the layout container itself.
layout-fill forces the layout element to fill its parent container.

Here is a non-trivial group of flex elements using layout-wrap

[flex=33]

[flex=66]

[flex=66]

[flex=33]

[flex=33]

[flex=33]

[flex=33]

layout-wrap allows flex children to wrap within the container if the elements use more than 100%.


Show & Hide

Use the show hide APIs to responsively show or hide elements. While these work similar to ng-show and ng-hide, these AngularJS Material Layout directives are mediaQuery-aware.

Only show on gt-sm devices.

Shown on small and medium.
Hidden on gt-sm devices.

Shown on small and medium size devices.
Hidden on gt-md devices.

Shown on medium size devices only.

Shown on devices larger than 1200px wide only.

hide (display: none)show (negates hide)Activates when:
hide-xsshow-xswidth < 600 px
hide-gt-xsshow-gt-xswidth >= 600 px
hide-smshow-sm600 px <= width < 960 px
hide-gt-smshow-gt-smwidth >= 960 px
hide-mdshow-md960 px <= width < 1280 px
hide-gt-mdshow-gt-mdwidth >= 1280 px
hide-lgshow-lg1280 px <= width < 1920 px
hide-gt-lgshow-gt-lgwidth >= 1920 px
hide-xlshow-xlwidth >= 1920 px