-
Notifications
You must be signed in to change notification settings - Fork 771
Home
Angular Flex Layout provides a sophisticated layout API using FlexBox CSS + mediaQuery. This module provides Angular (v2.4.3 and higher) developers with component layout features using a custom Layout API, mediaQuery observables,and injected DOM flexbox-2016 css stylings.
The Layout engine intelligently automates the process of applying appropriate FlexBox CSS to browser view hierarchies. This automation also addresses many of the complexities and workarounds encountered with the traditional, manual, CSS-only application of Flexbox CSS.
Angular Flex Layout is a pure-Typescript Layout engine; unlike the pure CSS-only implementations published in other Flexbox libraries and the JS+CSS implementation of Angular Material v1.x Layouts.
- This implementation of Angular Flex Layouts is independent of Angular Material (v1 or v2).
- This implementation is currently only available for Angular (v2.4.3 and higher) applications.
The Angular Flexbox Layout features enable developers to organize UI page elements in row and column structures with alignments, resizing, and padding. These layouts can be nested and easily used with hierarchical DOM structures.
Since the Layout applies/injects Flexbox CSS, Browsers will will fluidly update DOM element positioning and sizes as the window viewport size changes.
<div class="flex-container" fxLayout="row" fxLayoutAlign="center center">
<div class="flex-item"></div>
<div class="flex-item"></div>
<div class="flex-item"></div>
</div>
Note: the above Flex-Layout usages do not require any external stylesheets nor any custom CSS programming. The Angular directives do all the work of magically setting the flexbox css styles.
Integrating mediaQuery features into the Layout engine enables the API to be Responsive: DOM elements can adjust layout-directions, visibility, and sizing constraints based on specific viewport sizes such as desktop or mobile devices.
<div class="flex-container"
fxLayout="row" fxLayout.xs="column"
fxLayoutAlign="center center" fxLayoutAlign.xs="start start">
<div class="flex-item"></div>
<div class="flex-item"></div>
<div class="flex-item"></div>
</div>
Learning FlexBox
Developers
- API Documentation
- Developer Setup
- Builds + Fast Start
- Integration with Angular CLI
- Webpack Configuration
Demos
Templates
One of the hardest features to implement is a grid layout with specific column spans. Our online demo shows how easy this is!
Live Demo:
![screen shot 2016-12-16 at 1 00 51 pm](https://cloud.githubusercontent.com/assets/210413/21274826/bc8553f2-c38f-11e6-8188-bc7fd36026c2.png)Source Code:
![screen shot 2016-12-16 at 1 05 45 pm](https://cloud.githubusercontent.com/assets/210413/21274996/6b640f8a-c390-11e6-87ac-ca85eb6c3983.png)-
Quick Links
-
Documentation
-
Demos
-
StackBlitz Templates
-
Learning FlexBox
-
History
-
Developer Guides
-
Contributing