Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ri-flex-layout

techiway101MIT1.3.0TypeScript support: included

An alternative library to Angular's deprecated angular-flex-layout library. ri-flex-layout helps you achieve responsive layouts in Angular applications with minimal code changes.

ri-flex-layout, flex-layout, angular flex layout, responsive design, responsive layout, angular layout, angular responsive, flexbox, css flexbox, flexbox layout, flexbox grid, css grid, layout library, angular UI layout, media query, angular material, angular responsive layout, angular replacement for flex layout, responsive angular layout, angular 19 layout, angular 16 flex, angular cdk, layout directives, flex directives, flex-wrap, row column layout, angular mobile responsive, angular desktop responsive, web development, frontend layout, responsive components

readme

RiFlexLayout

An alternative library to Angular's deprecated angular-flex-layout library. ri-flex-layout helps you achieve responsive layouts in Angular applications with minimal code changes.

License: MIT npm version npm downloads


Versions Compatibility

Angular Version ri-flex-layout Version
>= 19.2.13 v1.3.x
>= 16.0.0 < 17.0.0 v1.2.2
>= 14.2.0 v1.1.1
>= 12.0.0 v1.1.0

Features

  • Drop-in replacement for angular-flex-layout
  • Fully responsive with breakpoint support
  • Works seamlessly with Angular CDK
  • Simple API: riFxLayout, riFxFlex, riFxLayoutAlign, and more
  • Supports ng add for quick setup

Getting Started

Installation

Install the necessary packages:

ng add @angular/cdk
npm install ri-flex-layout

Import the Module

Import RiFlexLayoutModule in your root module (AppModule):

import { NgModule } from '@angular/core';
import { RiFlexLayoutModule } from 'ri-flex-layout';

@NgModule({
  declarations: [...],
  imports: [
    ...,
    RiFlexLayoutModule
  ],
  bootstrap: [...]
})
export class AppModule { }

Usage

Start using layout directives in your templates:

Row Layout Example

<div riFxLayout="row" riFxLayoutAlign="space-between center" riFxLayoutGap="10px">
  <div riFxFlex="40">Sample div</div>
  <div riFxFlex>Test div</div>
</div>

Column Layout Example

<div riFxLayout="column" riFxLayoutAlign="space-around center" riFxLayoutGap="10px">
  <div riFxFlex="50">Column 1</div>
  <div riFxFlex>Column 2</div>
</div>

Responsive Layout Example

<div 
  riFxLayout="row wrap"
  riFxLayout.xs="column"
  riFxLayoutAlign="space-between"
  riFxLayoutGap="10px"
  riFxLayoutGap.xs="10px"
>
  <div riFxFlex="33" riFxFlex.xs="100">Sample Div 1</div>
  <div riFxFlex="33" riFxFlex.xs="100">Sample Div 2</div>
  <div riFxFlex="33" riFxFlex.xs="100">Sample Div 3</div>
</div>

Live Demo

Try it on StackBlitz (Coming Soon) 🚀


License

This project is licensed under the MIT License. See the LICENSE file for more details.