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

@arterial/checkbox

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arterial/checkbox

Another React Material Checkbox

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Arterial Checkbox

Another React Material Checkbox

Installation

npm install @arterial/checkbox

Usage

Styles

Sass
@use "@material/checkbox/index.scss" as checkbox;
@include checkbox.core-styles;
CSS
import '@material/checkbox/dist/mdc.checkbox.css';

JSX

import {Checkbox} from '@arterial/checkbox';

Checked Checkbox

function Checked() {
  const [checked, setChecked] = useState(true);
  return (
    <Checkbox
      checked={checked}
      id="checkbox-checked"
      onChange={e => setChecked(e.target.checked)}
    />
  );
}

Unchecked Checkbox

function Unchecked() {
  const [checked, setChecked] = useState(false);
  return (
    <Checkbox
      checked={checked}
      id="checkbox-unchecked"
      onChange={e => setChecked(e.target.checked)}
    />
  );
}

Indeterminate Checkbox

function Indeterminate() {
  const [checked, setChecked] = useState(false);
  const [indeterminate, setIndeterminate] = useState(true);
  return (
    <Checkbox
      checked={checked}
      id="checkbox-indeterminate"
      indeterminate={indeterminate}
      onChange={e => {
        setChecked(e.target.checked);
        setIndeterminate(e.target.indeterminate);
      }}
    />
  );
}

Other Variants

Label

function Label() {
  const [checked, setChecked] = useState(true);
  return (
    <Checkbox
      checked={checked}
      id="checkbox-label"
      label="Checkbox"
      onChange={e => setChecked(e.target.checked)}
    />
  );
}

Align End

function AlignEnd() {
  const [checked, setChecked] = useState(true);
  return (
    <Checkbox
      alignEnd
      checked={checked}
      id="checkbox-align-end"
      label="Checkbox"
      onChange={e => setChecked(e.target.checked)}
    />
  );
}

Disabled

<Checkbox
  disabled
  id="checkbox-disabled"
  label="Checkbox"
  onChange={() => {}}
/>

Props

Checkbox

NameTypeDescription
alignEndbooleanAligns root element on the right side of the label.
checkedbooleanIndicates whether the element is checked.
classNamestringClasses to be applied to the root element.
disabledbooleanIndicates whether the element is disabled.
idstringId of the element.
indeterminateboolIndicates whether the checkbox is indeterminate.
labelstringText to be displayed next to the root element.
onChangefunctionChange event handler.
ripplebooleanEnables ripple within root element. Defaults to true.
styleobjectStyles to be applied to the root element.
valuestringValue of input.

FAQs

Package last updated on 24 Dec 2020

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