Is Angular 4 material responsive like bootstrap?
Asked Answered
B

2

30

I am starting on a new project with Angular 4 and need to create responsive and pleasant user interface.

  • bootstrap gives you responsiveness, but no material feel
  • angular material provides that nice UI experience https://material.angular.io

I know bootstrap and used it in previous AngularJS apps, but angular material is new to me. It seems easy to follow docs but i cannot find the responsiveness support.

I don't want to mix them but have not been able to find that column responsiveness for mobile support that bootstrap provides.

Am I missing something? Does angular material support similar responsiveness or should I used both in my app?

Bactria answered 24/7, 2017 at 21:58 Comment(3)
Check @angular/flex-layout. The material components are responsive up to some extent (font size, text decorators, etc), but to create responsive layouts, angular offers the mentioned package.Least
will it work with @angular/material without conflicts?Bactria
yes, no problemsLeast
T
34

To add responsiveness in modern angular app you can use Flex-layout it is completely separate from material2 so you can use that even without using material2 in your app.

Bare in mind that as flex-layout is based on Flexbox CSS so it is not supported in old browsers.

Here are some examples

Also check out the new ngAir episode episode talking about Flex-Layout

UPDATE:

Starting from 6.0.0-beta.16 flex-layout now has an API to support CSS Grid. You can find more details by checking pr#712

Taxexempt answered 24/7, 2017 at 23:4 Comment(4)
I laughed when I tried it and learned that it just shrinks the contents instead of letting each contents collapse naturally as the view size changes. :DBushranger
@JhourladEstrella Have you gone through Responsive API for flexbox ?Inorganic
But it seems that all the releases are in betaInsula
@AbhinandanKhilari github.com/angular/flex-layout/issues/713Taxexempt
B
1

A bit late but I have created a starter template that shows an example of a responsive layout with Material 5 and Angular 5 as well as some simple routing. https://github.com/kenji-1996/material-sidenav-responsive-starter

Uses Material and Flex, no outside libs

Bonheur answered 3/4, 2018 at 3:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.