0.17.0 • Published 15 days ago

@bolttech/atoms-checkbox v0.17.0

Weekly downloads
-
License
-
Repository
-
Last release
15 days ago

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.

0.17.0

15 days ago

0.16.2

2 months ago

0.16.1

4 months ago

0.11.0

9 months ago

0.12.0

9 months ago

0.13.0

8 months ago

0.14.0

7 months ago

0.15.0

6 months ago

0.16.0

6 months ago

0.15.1

6 months ago

0.10.0

9 months ago

0.9.0

9 months ago

0.8.0

10 months ago

0.2.3

10 months ago

0.5.0

10 months ago

0.4.0

10 months ago

0.3.1

10 months ago

0.7.0

10 months ago

0.6.0

10 months ago

0.3.0

11 months ago

0.1.10

12 months ago

0.2.1

11 months ago

0.2.0

12 months ago

0.1.9

12 months ago

0.2.2

11 months ago

0.0.1

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago