ListItemCheckbox

Install

yarn add @ntds/list

Import

import { ListItemCheckbox } from '@ntds/list';

Props

ListItemCheckbox

PropType & Description
label
string

Main label text displayed in the list item

icon
any

Optional icon displayed before the label

name
string

The name of the Checkbox

value
string

This prop need to be included when using the Checkbox in a CheckboxList.

setValue
(flag: boolean) => void

Pass your setter from useState() directly here.

checked
boolean | { name: string; checked: boolean; }[]

Whether or not the checkbox is checked, or the current state of the checkbox.

disabled
boolean

Make a checkbox disabled.

hasError
boolean

Mark the input as invalid both visually and semantically.

numberLabel
number

A number which is displayed to the right of the checkbox.

onChange
(event: ChangeEvent<HTMLInputElement>) => void

A callback that gets triggered when a checkbox is clicked.

children
ReactNode

Usually simple text, but can be anything.

This guide is based on version: 2.1.7