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

@rei/cdr-checkbox

Package Overview
Dependencies
Maintainers
5
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rei/cdr-checkbox

REI Cedar Style Framework - Vue Component for Checkbox

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by100%
Maintainers
5
Weekly downloads
 
Created
Source

NOTE: v-model is required.

Events

| Name | Type | Description | | | --- | --- | --- | | change | value, event | v-model value. Fires on check/uncheck. |

Examples

Standard checkbox

v-model is a boolean. Checkbox value is either true or false.

var model = false;

<cdr-checkbox v-model="model">Checkbox: {{model}}</cdr-checkbox>
Standard checkbox with custom true/false values

Set true-value and/or false-value to desired checked and unchecked values.

var model = '';

<cdr-checkbox v-model="model" true-value="checked" false-value="unchecked">Checkbox: {{model}}</cdr-checkbox>
Group of checkboxes

v-model is an Array. Set checkbox value with custom-value.

var model = [];
var valE = {val: 'X', otherVal: 'Y', more: [8,9]};

<div>
  <cdr-checkbox custom-value="A" v-model="model">A</cdr-checkbox>
  <cdr-checkbox custom-value="B" v-model="model">B</cdr-checkbox>
  <cdr-checkbox :custom-value="{value: 'C'}" v-model="model">C</cdr-checkbox>
  <cdr-checkbox :custom-value="[1,2,3]" v-model="model">D</cdr-checkbox>
  <cdr-checkbox :custom-value="valE" v-model="model">E</cdr-checkbox>
  <p>Value: {{model}}</p>
</div>
Preselected

Standard: set v-model value to true.

var model = true;

<cdr-checkbox v-model="model">Checkbox: {{model}}</cdr-checkbox>

Multiple: add value to the v-model array.

var model = ["A", {value: 'C'}, [1,2,3]];
var valE = {val: 'X', otherVal: 'Y', more: [8,9]};

<div>
  <cdr-checkbox custom-value="A" v-model="model">A</cdr-checkbox>
  <cdr-checkbox custom-value="B" v-model="model">B</cdr-checkbox>
  <cdr-checkbox :custom-value="{value: 'C'}" v-model="model">C</cdr-checkbox>
  <cdr-checkbox :custom-value="[1,2,3]" v-model="model">D</cdr-checkbox>
  <cdr-checkbox :custom-value="valE" v-model="model">E</cdr-checkbox>
  <p>Value: {{model}}</p>
</div>
Event

Open console to see output

var model = false;

function eventExample(val) {
  console.log(val + ' was selected');
}

<cdr-checkbox @change="eventExample" v-model="model">Checkbox: {{model}}</cdr-checkbox>

FAQs

Package last updated on 14 Feb 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

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