Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@carry0987/check-box

Package Overview
Dependencies
Maintainers
0
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@carry0987/check-box

A library for create and manage checkbox elements

  • 2.2.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
44
increased by266.67%
Maintainers
0
Weekly downloads
 
Created
Source

CheckBox-JS

version CI
A library for create and manage checkbox elements

Installation

pnpm i @carry0987/check-box

Usage

Here is a simple example to use CheckBox-JS

UMD
<div id="app">
    <input type="checkbox" id="check-all" title="Check All">
    <div class="check-box-list">
        <input type="checkbox" name="check-no-title" checked>
        <input type="checkbox" name="check-1" data-checkbox-id="check-1" value="Test-1">
        <label data-checkbox-for="check-1" class="test">Check-1</label>
        <input type="checkbox" name="check-2" id="check-2" value="Test-2">
        <label for="check-2">Check-2</label>
        <input type="checkbox" name="check-3" id="check-3" value="Test-3">
        <label for="check-3">Check-3</label>
    </div>
    <input type="checkbox" id="check-all-2" title="Check All">
</div>
<link rel="stylesheet" href="dist/theme/checkBox.min.css">
<script src="dist/checkBox.min.js"></script>
<script type="text/javascript">
let checkBox = new checkBoxjs.CheckBox('#app .check-box-list input', {
    bindLabel: true,
    checkAll: ['#check-all', '#check-all-2'],
    allowShiftKey: true,
    onChange: (total, target) => {
        console.log(target);
        if (target) console.log(target);
    },
    onCheckAll: (total) => {
        console.log(total);
    },
    styles: {
        '#check-all ~ label': {
            fontWeight: 'bold'
        }
    }
});
checkBox.onChange = (total, target) => {
    console.log('Total: ', total);
    if (target) console.log(target);
};
document.getElementById('version').innerText = checkBoxjs.CheckBox.version;
</script>
ES Module
import { CheckBox } from '@carry0987/check-box';
import '@carry0987/check-box/theme/checkBox.min.css';

let checkBox = new CheckBox('#app .check-box-list input', {
    //...
});

Keywords

FAQs

Package last updated on 17 Oct 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc