1.0.4 • Published 1 year ago

ifo-alphabetic-checkboxes-list-component v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

ifo-alphabetic-checkBoxes-list-component

Alphabetic All Component

This component renders a list of checkboxes and provides functionality to select individual checkboxes or select all checkboxes at once.

Installation

First, ensure you have the ifo-alphabetic-checkboxes-list-component installed:

npm i ifo-alphabetic-checkboxes-list-component

#Usage

import React, { useState } from 'react';
import AlphabaticCheckboxes from 'ifo-alphabetic-checkboxes-list-component';

const AlphabeticAll = () => {
  const [state, setState] = useState({
    items: [
      { value: '1', label: 'A1' },
      { value: '2', label: 'A2' },
      { value: '3', label: 'A3' },
      { value: '4', label: 'A4' },
      { value: '5', label: 'A5' },
      { value: '6', label: 'b1' },
    ],
    isAllSelected: false,
    selectIds: [],
  });

  const handleCheck = (e) => {
    const { id, checked } = e.target;
    // Handle individual checkbox check/uncheck logic here
  };

  const handleSelectAll = (e) => {
    const { checked } = e.target;
    // Handle select all check/uncheck logic here
  };

  const { items, isAllSelected, selectIds } = state;

  return (
    <>
      <AlphabaticCheckboxes
        itemList={items}
        handleCheck={handleCheck}
        selectIds={selectIds}
        handleSelectAll={handleSelectAll}
        isAllSelected={isAllSelected}
      />
    </>
  );
};

export default AlphabeticAll;

#Explanation

checkboxeslist

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago