If you want to check something off your list, you're in the right place!
1import { Checkbox } from "@codeday/topo/Atom";
Look at the Chakra-UI docs for live previews, this documentation libary doesn't support previewing components and having editable text so I'm just sending you there.
1function IndeterminateExample() {2const [checkedItems, setCheckedItems] = React.useState([false, false]);34const allChecked = checkedItems.every(Boolean);5const isIndeterminate = checkedItems.some(Boolean) && !allChecked;67return (8<>9<Checkbox10isChecked={allChecked}11isIndeterminate={isIndeterminate}12onChange={(e) => setCheckedItems([e.target.checked, e.target.checked])}13>14Parent Checkbox15</Checkbox>16<Stack pl={6} mt={1} spacing={1}>17<Checkbox18isChecked={checkedItems[0]}19onChange={(e) => setCheckedItems([e.target.checked, checkedItems[1]])}20>21Child Checkbox 122</Checkbox>23<Checkbox24isChecked={checkedItems[1]}25onChange={(e) => setCheckedItems([checkedItems[0], e.target.checked])}26>27Child Checkbox 228</Checkbox>29</Stack>30</>31);32}
1/**2* 1. Create a custom icon that accepts 2 props: `isIndeterminate` and `isChecked`3*/4function CustomIcon(props) {5const { isIndeterminate, isChecked, ...rest } = props;67const d = isIndeterminate8? "M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z"9: "M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z";1011return (12<Icon viewBox="0 0 24 24" {...rest}>13<path fill="currentColor" d={d} />14</Icon>15);16}1718function CustomCheckbox() {19return (20<Checkbox icon={<CustomIcon />} colorScheme="cyan">21Hello world22</Checkbox>23);24}2526render(<CustomCheckbox />);