You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

@chakra-ui/checkbox

Package Overview
Dependencies
Maintainers
2
Versions
535
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chakra-ui/checkbox

A React Checkbox component for use in forms

2.3.2
latest
Source
npm
Version published
Weekly downloads
412K
-2.52%
Maintainers
2
Weekly downloads
 
Created

What is @chakra-ui/checkbox?

@chakra-ui/checkbox is a component library for creating accessible and customizable checkbox components in React applications. It is part of the Chakra UI library, which provides a set of accessible, reusable, and composable React components.

What are @chakra-ui/checkbox's main functionalities?

Basic Checkbox

This feature allows you to create a basic checkbox component. The Checkbox component can be used to render a simple checkbox with a label.

import { Checkbox } from '@chakra-ui/react';

function BasicCheckbox() {
  return <Checkbox>Checkbox</Checkbox>;
}

Checkbox Group

This feature allows you to create a group of checkboxes. The CheckboxGroup component helps manage the state of multiple checkboxes and can be used to render a group of checkboxes with a shared color scheme and default values.

import { Checkbox, CheckboxGroup } from '@chakra-ui/react';

function CheckboxGroupExample() {
  return (
    <CheckboxGroup colorScheme="green" defaultValue={['one', 'two']}>
      <Checkbox value="one">One</Checkbox>
      <Checkbox value="two">Two</Checkbox>
      <Checkbox value="three">Three</Checkbox>
    </CheckboxGroup>
  );
}

Indeterminate Checkbox

This feature allows you to create an indeterminate checkbox. The useCheckbox hook can be used to manage the state of the checkbox and set it to an indeterminate state.

import { Checkbox, useCheckbox } from '@chakra-ui/react';

function IndeterminateCheckbox() {
  const { getCheckboxProps, getInputProps } = useCheckbox({
    isIndeterminate: true,
  });

  return (
    <Checkbox {...getCheckboxProps()}>
      <input {...getInputProps()} />
      Indeterminate Checkbox
    </Checkbox>
  );
}

Other packages similar to @chakra-ui/checkbox

Keywords

react

FAQs

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