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

@bolttech/atoms-checkbox

Package Overview
Dependencies
Maintainers
8
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bolttech/atoms-checkbox

A simple React checkbox component.

  • 0.16.0
  • npm
  • Socket score

Version published
Weekly downloads
314
decreased by-30.99%
Maintainers
8
Weekly downloads
 
Created
Source

Checkbox Component

A simple React checkbox component.

Installation

Use the package manager npm or yarn to install the component.

npm install @bolttech/frontend-foundations @bolttech/atoms-checkbox

or

yarn add @bolttech/frontend-foundations @bolttech/atoms-checkbox

Props

The Checkbox component accepts the following properties:

PropTypeDescription
idstringThe ID attribute for the checkbox element.
labelstringThe label text for the checkbox.
disabledbooleanDisables the checkbox when set to true.
errorMessagestringAn optional error message to be displayed.
refobjectA reference object for the checkbox element.
checkedbooleanDetermines whether the checkbox is checked or not.
onChangefunctionCallback function to handle the checkbox change event.
onBlurfunctionCallback function to handle the checkbox blur event.
onFocusfunctionCallback function to handle the checkbox focus event.

Usage

import React, {useState} from 'react';
import {Checkbox} from '@bolttech/atoms-checkbox';
import {bolttechTheme, BolttechThemeProvider} from "@bolttech/frontend-foundations";

const ExampleComponent = () => {
  const [isChecked, setIsChecked] = useState(false);

  const handleCheckboxChange = (event) => {
    setIsChecked(event.target.checked);
  };

  return (
    <BolttechThemeProvider theme={bolttechTheme}>
      <Checkbox
        id="custom-checkbox"
        label="Check me"
        disabled={false}
        errorMessage="This field is required"
        checked={isChecked}
        onChange={handleCheckboxChange}
      />
    </BolttechThemeProvider>
  );
};

export default ExampleComponent;

Contributing

Contributions are welcome! For any bug fixes, improvements, or new features, please open an issue or submit a pull request.

Please make sure to follow the code standards and test your changes before submitting.

FAQs

Package last updated on 21 Nov 2023

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