Simple little component to display images in grid with fashion.
npm install image-quadcomponent to be used within Angular applications.
Angular >=17.0.0 and its introduces features like standalone components, new template controls and recursive component hierarchy.
projects/image-quad directory of this repository.
npm i image-quad
import { ImageQuadComponent } from 'image-quad'selector: ngx-image-quad
ImageQuadComponent in your app module.
import { ImageQuadComponent } from 'image-quad';
typescript
import { HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatAutocompleteModule, MatInputModule } from '@angular/material';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ImageQuadComponent } from 'image-quad';
import { AppComponent } from './app.component';
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
BrowserAnimationsModule,
FormsModule,
ReactiveFormsModule,
MatInputModule,
MatAutocompleteModule,
HttpClientModule,
ImageQuadComponent
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {}
`
2) Use (ImageQuadComponent) in your component.
`typescript
import { Component, OnInit } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { AppService } from './app.service';
@Component({
selector: 'app-root',
template:
})
export class AppComponent implements OnInit {
imagePaths = ['./assets/image1.png','./assets/imageAB.png','./assets/image123.png'];
constructor() {}
}
`
$3
As a minimum, you need to specify mode and imagePaths:
`
`
For responsiveness you can detect screen size and set size parameter accordingly:
`
``