nms-ui-switch

switch button for angular4

zzz
Last updated 2 years ago by ssaso .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install nms-ui-switch 
SYNC missed versions from official npm registry.

Ngx UI Switch Component

Greenkeeper badge Gitter Build Status npm version npm Throughput Graph

Description

This is a simple iOS 7 style switch component for Angular4.

Live demo

alt

Inspired by switchery - in angular4.

Installation

npm install ngx-ui-switch --save

Usage

import { UiSwitchModule } from 'ngx-ui-switch';
import { AppComponent } from './app.component';

@NgModule({
    imports: [BrowserModule, FormsModule, UiSwitchModule],
    declarations: [AppComponent],
    bootstrap: [AppComponent]
})
export class AppModule {
}
<ui-switch></ui-switch>

Two way binding

<ui-switch [(ngModel)]="enable"></ui-switch>

Params

checked

type: boolean

default: false

<ui-switch checked></ui-switch>
<ui-switch [checked]="false"></ui-switch>

disabled

type: boolean

default: false

<ui-switch disabled></ui-switch>
<ui-switch checked [disabled]="true"></ui-switch>

change

type: event

default: noop

<ui-switch (change)="onChange($event)"></ui-switch>

size

type: string

default: medium

<ui-switch size="small"></ui-switch>
<ui-switch size="large"></ui-switch>

reverse

type: boolean

default: false

<ui-switch reverse></ui-switch>

color

type: string

default: rgb(100, 189, 99)

<ui-switch color="red"></ui-switch>

switchColor

type: string

default: #fff

<ui-switch switchColor="#fcfcfc"></ui-switch>

defaultBgColor

type: string

default: #fff

<ui-switch defaultBgColor="red"></ui-switch>

defaultBoColor

type: string

default: #dfdfdf

<ui-switch defaultBgColor="black"></ui-switch>

FAQ

License

MIT

Current Tags

  • 2.0.0                                ...           latest (2 years ago)

1 Versions

  • 2.0.0 [deprecated]           ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |