Socket
Book a DemoInstallSign in
Socket

ngx-slider-moby

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-slider-moby

Angular slider component

latest
Source
npmnpm
Version
2.0.6
Version published
Maintainers
1
Created
Source

Ngx Slider Moby.

Reactive slider/scope slider component for angular.

Live demo: https://pavelpleshko-slider-moby.now.sh

Screenshot

main_screen

Get started

Slider supports touch events for mobile devices.

Install package itself

npm install ngx-slider-moby --save

How to use

Include NgxSliderMobyModule into your module like so:

import { NgxSliderMobyModule } from 'ngx-slider-moby';
...
@NgModule({
  imports: [
    NgxSliderMobyModule
  ],
})
export class YourModule { }

Inclusion of module will give you access to the slider component which you can include in your components. Example:

<ngx-slider-moby [max_value]="300" [min_value]="0" [range]="true"></ngx-slider-moby>

Can be used as form control(implements ControlValueAccessor interface) like so:

<div [formGroup]="myForm">
<ngx-slider-moby [max_value]="300" [min_value]="0" [range]="true" formControlName="priceRange"></ngx-slider-moby>
<ngx-slider-moby [max_value]="10" [min_value]="0" [range]="false" formControlName="kilogramms"></ngx-slider-moby>
</div>

NOTE: In case when you are using [range]="true" form control value will be as follows:

{from:20,to:55}

NOTE: If you want to use vertical slider specifying [vertical]="true" parent's height should be also specified otherwise component will behave unexpectedly.

Inputs

PropTypeDefaultDescription
min_valuenumber0minimal value for given slider
max_valuenumber500maximal value for given slider
value_fromnumber0If specified will assign provided value to the component value1 variable
value_tonumber0Similar with above but for value2 variable
showThumbLabelsbooleantruewhether or not to show labels on default slider(not range)
verticalbooleantrueIf false then the slider will appear horizontally
stepnumber1Allows to specify the number of units that one step has
rangebooleanfalseIf speified true then the slider will be a scope slider and have corresponding value and appearance(ex.: from 30 to 50). Thumblabels are visible by default in this type of slider
disabledbooleanfalseIf true then puts slider in a disabled state and doesn't handle any events on the element
direction'ltr' or 'rtl'ltrLeft to right or right to left(not implemeneted yet)
colorstringpurpleSlider will assume the corresponding color palette. Options: red,green,blue,purple,yellow

Events

valueChange - emits the object which looks like this in case of default slider {sliderId:string,value:number,percent:number},in case of range slider as follows:

{sliderId:string, value: {from:number,to:number}, percent: {from:number,to:number} }

blurred - blur event emits boolean true or false;

focused - focus event emits boolean true or false;

Update 2.0.0 info.

  • Major bug fixes.
  • Animation runs smoother.

Update 1.1.0 info.

  • Added colors 'black','grey'.
  • Added support of floating step.
  • Fixed some bugs.

Keywords

slider

FAQs

Package last updated on 23 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts