Code Monkey home page Code Monkey logo

masonry-tile's Introduction

npm version Downloads GitHub license

Masonry Tile

Allows you to have masonry style tiles with Material Grid List.

Installation

npm i masonry-tile --save

Requirements

  • peerDependencies:

    • angular 18.0.0 and more
    • angular/material 18.0.0 and more

Use for older versions:

  • 1.1.0: angular >= 16.0.0 & angular/material >= 16.0.0
  • 1.0.0: angular >= 13.0.0 & angular/material >= 13.0.0

Demo

See a demo.

Usage

example

Example with a list of images and description.

<mat-grid-list #matGridList [cols]="4">
    <mat-grid-tile *ngFor="let imageItem of images" #matGridTile>
        <masonry-tile [rowHeight]="1" [gutterSize]="1" [matGridTile]="matGridTile" [matGridList]="matGridList">
            <!-- content start -->
            <img [src]="imageItem?.src" [alt]="imageItem?.alt" />
            <div>{{ imageItem?.alt }}</div>
            <!-- content end -->
        </masonry-tile>
    </mat-grid-tile>
</mat-grid-list>
  • matGridTile (Required) : reference to matGridTile
  • matGridList (Required) : reference to matGridList

Include in your module:

import { MatGridListModule } from '@angular/material/grid-list';
import { MasonryTileModule } from 'masonry-tile';

@NgModule({
    imports: [
        MatGridListModule, // required
        MasonryTileModule,
    ],
})
export class MyModule {}

Publishing the library

npm run build:lib
npm run publish:lib

Update Demo

npm run build:demo

License

Like Angular, this module is released under the permissive MIT license. Your contributions are always welcome.

masonry-tile's People

Contributors

zefling avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.