npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ngx-pretty-checkbox

v18.0.0

Published

Quickly integrate pretty checkbox Components (checkbox, switch, radio button) with Angular

Downloads

2,311

Readme

Changes log

| ngx-pretty-checkbox | angular | feature | |---------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 18.0.0 | 18.x | | | 17.0.1 | 17.x | | | 16.0.0 | 16.x | | | 15.1.0 | 15.x | Stateless checkbox. There is no local state to update the checkbox by the user interaction. The component emit only the new state event. Use case: for a one-way data binding. For example, when the checkbox is clicked, a request should be sent to the server and the UI should be updated if the response is successful. | | 15.0.0 | 15.x | Standalone component | | 12.0.0 | 12.x | | | 11.0.0 | 11.x | | | 1.2.0 | >10.x | ivy | | 1.1.0 | >8.x | | | 1.0.4 | 6.x 7.x | |

Installation

  • Step 1

Install the pretty-checkbox from npm or yarn package manager

> npm install pretty-checkbox // or
> yarn add pretty-checkbox

Alternatively, you can also use CDN link

https://cdn.jsdelivr.net/npm/[email protected]/dist/pretty-checkbox.min.css
  • Step 2

Download pretty-checkbox angular module from npm package manager

> npm install ngx-pretty-checkbox
  • Step 3

Add dist/pretty-checkbox.min.css file from node_module of pretty-checkbox in your html or import src/pretty-checkbox.scss file in your scss file

@import '~pretty-checkbox/src/pretty-checkbox.scss';
  • Step 4

Add ngx-pretty-checkbox in your AppModule or component to import all standalone components

import { NgxPrettyCheckboxModule } from 'ngx-pretty-checkbox';

@NgModule({
  imports: [
    ...,
    NgxPrettyCheckboxModule
  ],
  ...
})
export class AppModule { 
  ...
}

Or import the ngx-pretty-checkbox standalone components to you component

import {
  NgxPrettyCheckboxComponent,
  NgxPrettyCheckboxWillChangeComponent,
  NgxPrettyHoverComponent,
  NgxPrettyHoverWillChangeComponent,
  NgxPrettyIconDirective,
  NgxPrettyImageDirective,
  NgxPrettyIndeterminateComponent,
  NgxPrettyIndeterminateWillChangeComponent,
  NgxPrettyRadioComponent,
  NgxPrettyRadioGroupDirective,
  NgxPrettyRadioWillChangeComponent,
  NgxPrettySvgDirective,
  NgxPrettyToggleComponent,
  NgxPrettyToggleWillChangeComponent,
} from 'ngx-pretty-checkbox';

@Component({
  standalone: true,
  imports: [
    NgxPrettyCheckboxComponent,
    NgxPrettyCheckboxWillChangeComponent,
    NgxPrettyHoverComponent,
    NgxPrettyHoverWillChangeComponent,
    NgxPrettyIndeterminateComponent,
    NgxPrettyIndeterminateWillChangeComponent,
    NgxPrettyRadioComponent,
    NgxPrettyRadioWillChangeComponent,
    NgxPrettyToggleComponent,
    NgxPrettyToggleWillChangeComponent,
    NgxPrettyIconDirective,
    NgxPrettyImageDirective,
    NgxPrettyRadioGroupDirective,
    NgxPrettySvgDirective
  ],
  selector: 'my-component',
  ...
})
export class MyComponent {
}
  • Step 5

Basic usage

<p-checkbox>
  Default
</p-checkbox>

Stateless usage

@Component({
  standalone: true,
  imports: [NgxPrettyCheckboxComponent],
  selector: 'app-root',
  template: `
    <p-checkbox [stateless]="true" [checked]="checked" (change)="onStateChange($event)">Stateless Checkbox</p-checkbox>
  `
})
export class MyComponent {
  
  public checked = false;

  private http = inject(HttpClient);
  private cd = inject(ChangeDetectorRef);
  
  onStateChange(change: PrettyCheckBoxChange) {
    this.http.post(...).subscribe(_ => {
      this.checked = true;
      this.cd.detectChanges();
    })
  }
}

More demos and document

There are more features like Radio buttons , Toggle , States , Animations , Border less , Lock , Scale, SCSS Settings.

Please refer the documentation to know about them.

Browser support

Works in all modern browsers.

Chrome >= 26 Firefox >= 16 Safari >= 6.1 Opera >= 15 IE >= 9

License

This project is licensed under the MIT License. Copyright (c) milad faghihi.