feat(interface/menu): checkbox

feat(package/interface/menu): checkbox
feat(web/menu/list): checkbox
feat(web/menu/list): checkbox option for ListItem
feat(web/menu/list): custom checkbox
This commit is contained in:
BerkieBb authored and Luke committed 2022-10-29 15:55:08 +02:00
1 parent de23227ea7
commit 5ba1a3b8f9
5 files changed
+125 -30

No files matched your search

@@ -0,0 +1,36 @@
import { Box, Flex, useCheckbox, chakra, CheckboxIcon } from '@chakra-ui/react';
const CustomCheckbox: React.FC<{ checked: boolean }> = ({ checked }) => {
const { getCheckboxProps, getInputProps, htmlProps } = useCheckbox();
return (
<chakra.label
display='flex'
flexDirection='row'
alignItems='center'
gridColumnGap={2}
pr={4}
cursor='pointer'
{...htmlProps}
>
<input {...getInputProps()} hidden />
<Flex
alignItems='center'
justifyContent='center'
border='2px solid'
borderColor='#909296'
rounded={'sm'}
w={6}
h={6}
{...getCheckboxProps()}
>
{checked && (
<Box w={5} h={5} bg='#25262B'>
<CheckboxIcon isChecked color={'#373A40'} />
</Box>
)}
</Flex>
</chakra.label>
)
};
export default CustomCheckbox;