DEV Community

loading...
Cover image for React TriStateCheckbox

React TriStateCheckbox

primetek profile image PrimeTek ・1 min read

React TriStateCheckbox is used to select either "true", "false" or "null" as the value.

Setup

Refer to PrimeReact setup documentation for download and installation steps for your environment.

Import

import {TriStateCheckbox} from 'primereact/tristatecheckbox';
Enter fullscreen mode Exit fullscreen mode

Getting Started

TriStateCheckbox is used as a controlled input with checked and onChange properties.

<TriStateCheckbox value={value} onChange={(e) => setValue(e.value)} />
Enter fullscreen mode Exit fullscreen mode

Theming

TriStateCheckbox supports various themes featuring Material, Bootstrap, Fluent as well as your own custom themes via the Designer tool.

Resources

Visit the PrimeReact TriStateCheckbox showcase for demos and documentation.

Discussion (0)

pic
Editor guide