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

cf-component-checkbox

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cf-component-checkbox

CloudFlare Checkbox Component

  • 1.0.0
  • npm
  • Socket score

Version published
Weekly downloads
1.5K
increased by1698.81%
Maintainers
1
Weekly downloads
 
Created
Source

cf-component-checkbox

CloudFlare Checkbox Component

Installation

$ npm install cf-component-checkbox

Usage

import React from 'react';
import {
  Checkbox,
  CheckboxGroup
} from '../src/index';

class Application extends React.Component {
  state = {
    checkbox1: true,
    checkbox2: false,
    checkboxValues: ["option1"]
  };

  onCheckboxGroupChange = values => {
    this.setState({
      checkboxValues: values
    });
  };

  render() {
    return (
      <div>
        <h1>CloudFlare Checkbox Component Example</h1>

        <p>You can create them individually with <code>Checkbox</code></p>

        <Checkbox
          label="Checkbox 1"
          name="checkbox-1"
          value="checkbox1"
          checked={this.state.checkbox1}
          onChange={checked => this.setState({ checkbox1: checked })}/>

        <Checkbox
          label="Checkbox 2"
          name="checkbox-2"
          value="checkbox2"
          checked={this.state.checkbox2}
          onChange={checked => this.setState({ checkbox2: checked })}/>

        <p>Or as a group with <code>CheckboxGroup</code></p>

        <CheckboxGroup
          values={this.state.checkboxValues}
          onChange={this.onCheckboxGroupChange}
          options={[
            { label: 'Option 1', name: 'group-option-1', value: 'option1' },
            { label: 'Option 2', name: 'group-option-2', value: 'option2' }
          ]}/>

        <p>You can also disable a label by passing <code>false</code> explicitly</p>

        <Checkbox
          label={false}
          name="checkbox-1-no-label"
          value="checkbox1"
          checked={this.state.checkbox1}
          onChange={checked => this.setState({ checkbox1: checked })}/>
      </div>
    );
  }
}

FAQs

Package last updated on 29 Dec 2015

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