Top

Advance UI Elements


Installation and Usage
npm i ngx-bar-rating
<ngb-rating [(rate)]="currentRate"></ngb-rating>
Installation and Usage
npm i ngx-dropzone

<dropzone body [config]="imageConfig" (error)="onUploadError($event)" (success)="onUploadSuccess($event)"
[message]="text"></dropzone>
              

you have add to type script files


import { Component } from '@angular/core';
import { DropzoneConfigInterface, DropzoneModule } from 'ngx-dropzone-wrapper';

@Component({
  selector: 'app-default-file-upload',
  imports:[DropzoneModule],
  templateUrl: './default-file-upload.component.html',
  styleUrls: ['./default-file-upload.component.scss']
})

export class DefaultFileUploadComponent {

  public imageConfig: DropzoneConfigInterface = {
    clickable: true,
    url: 'https://httpbin.org/post',
    addRemoveLinks: true,
    parallelUploads: 1,
  };

  public text = 'Drag & Drop your files or Browse';
  
  onUploadError(args: any): void {
    console.log("onUploadError:", args);
  }

  onUploadSuccess(args: any): void {
    console.log("onUploadSuccess:", args);
  }

}


Installation and Usage
npm install --save sweetalert2

<div class="card height-equal">
    <div class="card-header">
      <h4>Basic Example</h4>
      <p class="f-m-light mt-1">Print the basic message.</p>
    </div>
    <div class="card-body btn-showcase">
      <button class="btn btn-primary sweet-1" type="button" (click)="basicAlert()">Click it!</button>
    </div>
  </div>


// ES6 Modules or TypeScript
import { Component } from '@angular/core';
import Swal from 'sweetalert2';

@Component({
  selector: 'app-basic-example',
  imports:[],
  templateUrl: './basic-example.component.html',
  styleUrls: ['./basic-example.component.scss']
})

export class BasicExampleComponent {

  basicAlert(){
    Swal.fire({
      title : 'Welcome! to the Mofi theme',
      confirmButtonColor : 'var(--theme-deafult)',
    })
  }

}

Installation and Usage
npm i ngx-owl-carousel-o
<div class="card">
  <div class="card-header">
    <h4>Slides Only </h4>
    <p class="f-m-light mt-1">The <code>.active</code> class needs to be added to one of the slides otherwise the
      carousel will not be visible.<code>.d-block</code> and <code>.w-100 </code> on carousel images to prevent browser
      default image alignment.</p>
  </div>
  <div class="card-body">
    <div class="carousel slide" id="carouselExampleSlidesOnly" data-bs-ride="carousel">
      <div class="carousel-inner">
        <owl-carousel-o [options]="slidesOnlyOptions">
          <ng-template carouselSlide class="carousel-item" *ngFor="let slideData of slidesOnlyData">
            <img class="d-block w-100" [src]="slideData.img" alt="">
        </ng-template>  
        </owl-carousel-o>
      </div>
    </div>
  </div>
</div>

import { Component } from '@angular/core';
import * as Data from '../../../../shared/data/data/bonus-ui/owl-carousel';
import { CarouselModule } from 'ngx-owl-carousel-o';

@Component({
  selector: 'app-slides-only',
  imports: [CarouselModule],
  templateUrl: './slides-only.component.html',
  styleUrls: ['./slides-only.component.scss']
})

export class SlidesOnlyComponent {

  public slidesOnlyOptions = Data.slidesOnlyOptions;
  public slidesOnlyData = Data.slidesOnlyData;

}

export const slidesOnlyData = [
  { id: 1, img: "assets/images/slider/11.jpg" },
  { id: 2, img: "assets/images/slider/9.jpg" },
  { id: 3, img: "assets/images/slider/6.jpg" },
];

export const slidesOnlyOptions = {
  loop: true,
  autoplay: true,
  mouseDrag: false,
  dots: false,
  nav: false,
  navSpeed: 700,
  responsive: {
    0: {
      items: 1,
    },
  },
};
Installation and Usage
npm i ng5-slider


<div class="card">
    <div class="card-header">
        <h4>Default Range Slider</h4>
        <p class="f-m-light mt-1">
            Use the <code>.range-slider </code> class. and Mofi used Ion range
            slider.<code>[http://ionden.com/a/plugins/ion.rangeSlider]</code></p>
    </div>
    <div class="card-body">
        <form class="theme-form form-label-align-right range-slider">
            <div class="form-group row py-1">
                <div class="col-md-10">
                    <ngx-slider [(value)]="value" [options]="options"></ngx-slider>
                </div>
            </div>
        </form>
    </div>
</div>

import { NgxSliderModule, Options } from "@angular-slider/ngx-slider";
import { Component } from "@angular/core";

@Component({
  selector: "app-default-slider",
  imports: [NgxSliderModule],
  templateUrl: "./default-slider.component.html",
  styleUrls: ["./default-slider.component.scss"],
})

export class DefaultSliderComponent {
  
  public value: number = 550;
  public options: Options = {
    floor: 100,
    ceil: 1000,
  };
}

Installation and Usage
npm i ngx-image-cropper

 <image-cropper [imageChangedEvent]="imageChangedEvent" [maintainAspectRatio]="true"
   [containWithinAspectRatio]="containWithinAspectRatio" [aspectRatio]="4 / 3"
   [resizeToWidth]="256" [cropperMinWidth]="128" [onlyScaleDown]="true" [roundCropper]="false"
   [canvasRotation]="canvasRotation" [transform]="transform" [alignImage]="'left'"
   [style.display]="showCropper ? null : 'none'" format="png"
   (imageCropped)="imageCropped($event)" (imageLoaded)="imageLoaded()">
 </image-cropper>


import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { ImageCroppedEvent, ImageCropperModule,ImageTransform } from 'ngx-image-cropper';

@Component({
  selector: 'app-image-cropper',
  imports:[FormsModule,ImageCropperModule],
  templateUrl: './image-cropper.component.html',
  styleUrls: ['./image-cropper.component.scss']
})

export class ImageCropperComponent {    

  public imageChangedEvent: string | null | undefined = '';
  public croppedImage: string | null | undefined = '';
  public canvasRotation = 0;
  public rotation = 0;
  public scale = 1;
  public showCropper = false;
  public containWithinAspectRatio = false;
  public transform: ImageTransform = {};

  fileChangeEvent(event: any): void {
      this.imageChangedEvent = event;
  }

  imageCropped(event: ImageCroppedEvent) {
      this.croppedImage = event.objectUrl;
  }

  imageLoaded() {
      this.showCropper = true;
  }

  rotateLeft() {
      this.canvasRotation--;
      this.flipAfterRotate();
  }

  rotateRight() {
      this.canvasRotation++;
      this.flipAfterRotate();
  }

  private flipAfterRotate() {
      const flippedH = this.transform.flipH;
      const flippedV = this.transform.flipV;
      this.transform = {
          ...this.transform,
          flipH: flippedV,
          flipV: flippedH
      };
  }

  flipHorizontal() {
      this.transform = {
          ...this.transform,
          flipH: !this.transform.flipH
      };
  }

  flipVertical() {
      this.transform = {
          ...this.transform,
          flipV: !this.transform.flipV
      };
  }

  resetImage() {
      this.scale = 1;
      this.rotation = 0;
      this.canvasRotation = 0;
      this.transform = {};
  }

  zoomOut() {
      this.scale -= .1;
      this.transform = {
          ...this.transform,
          scale: this.scale
      };
  }

  zoomIn() {
      this.scale += .1;
      this.transform = {
          ...this.transform,
          scale: this.scale
      };
  }

  toggleContainWithinAspectRatio() {
      this.containWithinAspectRatio = !this.containWithinAspectRatio;
  }

  updateRotation() {
    this.transform = {
        ...this.transform,
        rotate: this.rotation
    };
}

}