
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
reactjs-checkbox-tree
Advanced tools
A simple and elegant checkbox tree for React.

This project is a refactor of the original reactjs-checkbox-tree by Jake Zatecky and contributors, updated and recompiled to be fully compatible with Vite 5 (2025) and its latest dependencies, with React 19 support.
--vars) for styling.Full credit to original author Jake Zatecky and all contributors at reactjs-checkbox-tree homepage.
This fork is maintained by royaltics-solutions due to lack of continuity in the original project.
yarn add reactjs-checkbox-tree
or
npm install reactjs-checkbox-tree --save
Import the pure CSS style:
import 'reactjs-checkbox-tree/lib/reactjs-checkbox-tree.css';
//Basic example:
import React, { useState } from 'react';
import CheckboxTree from 'reactjs-checkbox-tree';
const nodes = [{
value: 'mars',
label: 'Mars',
children: [
{ value: 'phobos', label: 'Phobos' },
{ value: 'deimos', label: 'Deimos' },
],
}];
function Widget() {
const [checked, setChecked] = useState([]);
const [expanded, setExpanded] = useState([]);
return (
<CheckboxTree
nodes={nodes}
checked={checked}
expanded={expanded}
onCheck={setChecked}
onExpand={setExpanded}
/>
);
}
Use iconsClass="fa4" for FontAwesome 4 support, or override icons with the icons prop:
<CheckboxTree
...
iconsClass="fa4"
icons={{
check: <span className="rct-icon rct-icon-check" />,
uncheck: <span className="rct-icon rct-icon-uncheck" />,
halfCheck: <span className="rct-icon rct-icon-half-check" />,
expandClose: <span className="rct-icon rct-icon-expand-close" />,
expandOpen: <span className="rct-icon rct-icon-expand-open" />,
expandAll: <span className="rct-icon rct-icon-expand-all" />,
collapseAll: <span className="rct-icon rct-icon-collapse-all" />,
parentClose: <span className="rct-icon rct-icon-parent-close" />,
parentOpen: <span className="rct-icon rct-icon-parent-open" />,
leaf: <span className="rct-icon rct-icon-leaf" />,
}}
/>
Or integrate with @fortawesome/reactjs-fontawesome:
import { FontAwesomeIcon } from '@fortawesome/reactjs-fontawesome'
<CheckboxTree
...
icons={{
check: <FontAwesomeIcon className="rct-icon rct-icon-check" icon="check-square" />,
uncheck: <FontAwesomeIcon className="rct-icon rct-icon-uncheck" icon={['fas', 'square']} />,
halfCheck: <FontAwesomeIcon className="rct-icon rct-icon-half-check" icon="check-square" />,
expandClose: <FontAwesomeIcon className="rct-icon rct-icon-expand-close" icon="chevron-right" />,
expandOpen: <FontAwesomeIcon className="rct-icon rct-icon-expand-open" icon="chevron-down" />,
expandAll: <FontAwesomeIcon className="rct-icon rct-icon-expand-all" icon="plus-square" />,
collapseAll: <FontAwesomeIcon className="rct-icon rct-icon-collapse-all" icon="minus-square" />,
parentClose: <FontAwesomeIcon className="rct-icon rct-icon-parent-close" icon="folder" />,
parentOpen: <FontAwesomeIcon className="rct-icon rct-icon-parent-open" icon="folder-open" />,
leaf: <FontAwesomeIcon className="rct-icon rct-icon-leaf-close" icon="file" />
}}
/>
import { CHECK_MODEL } from "../components/constants";
export interface Icons {
check: React.ReactNode;
uncheck: React.ReactNode;
halfCheck: React.ReactNode;
expandClose: React.ReactNode;
expandOpen: React.ReactNode;
expandAll: React.ReactNode;
collapseAll: React.ReactNode;
parentClose: React.ReactNode;
parentOpen: React.ReactNode;
leaf: React.ReactNode;
}
export interface Language {
collapseAll: string;
expandAll: string;
toggle: string;
}
export interface TreeNodeInfo {
value: string;
checked?: boolean;
halfCheck?: boolean;
expanded?: boolean;
disabled?: boolean;
}
export interface CheckboxTreeNode extends TreeNodeInfo {
label: string;
title?: string;
children?: CheckboxTreeNode[];
showCheckbox?: boolean;
className?: string;
parent?: CheckboxTreeNode;
icon?: React.ReactNode;
isChild?: boolean;
isParent?: boolean;
isLeaf?: boolean;
treeDepth?: number;
index?: number;
}
export interface NodeModelProps {
disabled?: boolean;
noCascade?: boolean;
}
export interface FlatNodes {
[value: string]: CheckboxTreeNode;
}
export interface CheckboxTreeProps {
nodes: CheckboxTreeNode[];
checkModel?: typeof CHECK_MODEL.LEAF | typeof CHECK_MODEL.ALL;
checked?: string[];
direction?: "ltr" | "rtl";
disabled?: boolean;
expandDisabled?: boolean;
expandOnClick?: boolean;
expanded?: string[];
icons?: Partial<Icons>;
id?: string | null;
lang?: Language;
nativeCheckboxes?: boolean;
noCascade?: boolean;
onlyLeafCheckboxes?: boolean;
optimisticToggle?: boolean;
showExpandAllButtons?: boolean;
showNodeIcon?: boolean;
showNodeTitle?: boolean;
onCheck?: (checked: string[], node: CheckboxTreeNode) => void;
onClick?: (node: CheckboxTreeNode) => void;
onExpand?: (expanded: string[], node?: CheckboxTreeNode) => void;
}
This fork is maintained by royaltics-solutions, preserving and modernizing the original work by:
Jake Zatecky and contributors Homepage: https://jakezatecky.github.io/reactjs-checkbox-tree Repo: https://github.com/jakezatecky/reactjs-checkbox-tree
Fork repo: https://github.com/royaltics-solutions/reactjs-checkbox-tree
FAQs
A simple and elegant checkbox tree for React.
We found that reactjs-checkbox-tree demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.