sidebar layouts
() => {const sidebar = useDisclosure();const integrations = useDisclosure();const color = useColorModeValue("gray.600", "gray.300");const NavItem = (props) => {const { icon, children, ...rest } = props;return (<Flexalign="center"px="4"pl="4"py="3"cursor="pointer"color="inherit"_dark={{color: "gray.400",}}_hover={{bg: "gray.100",_dark: {bg: "gray.900",},color: "gray.900",}}role="group"fontWeight="semibold"transition=".15s ease"{...rest}>{icon && (<Iconmx="2"boxSize="4"_groupHover={{color: color,}}as={icon}/>)}{children}</Flex>);};const SidebarContent = (props) => (<Boxas="nav"pos="fixed"top="0"left="0"zIndex="sticky"h="full"pb="10"overflowX="hidden"overflowY="auto"bg="white"_dark={{bg: "gray.800",}}bordercolor="inherit"borderRightWidth="1px"w="60"{...props}><Flex px="4" py="5" align="center"><Logo /><TextfontSize="2xl"ml="2"color="brand.500"_dark={{color: "white",}}fontWeight="semibold">Choc UI</Text></Flex><Flexdirection="column"as="nav"fontSize="sm"color="gray.600"aria-label="Main Navigation"><NavItem icon={MdHome}>Home</NavItem><NavItem icon={FaRss}>Articles</NavItem><NavItem icon={HiCollection}>Collections</NavItem><NavItem icon={FaClipboardCheck}>Checklists</NavItem><NavItem icon={HiCode} onClick={integrations.onToggle}>Integrations<Iconas={MdKeyboardArrowRight}ml="auto"transform={integrations.isOpen && "rotate(90deg)"}/></NavItem><Collapse in={integrations.isOpen}><NavItem pl="12" py="2">Shopify</NavItem><NavItem pl="12" py="2">Slack</NavItem><NavItem pl="12" py="2">Zapier</NavItem></Collapse><NavItem icon={AiFillGift}>Changelog</NavItem><NavItem icon={BsGearFill}>Settings</NavItem></Flex></Box>);return (<Boxas="section"bg="gray.50"_dark={{bg: "gray.700",}}minH="100vh"><SidebarContentdisplay={{base: "none",md: "unset",}}/><DrawerisOpen={sidebar.isOpen}onClose={sidebar.onClose}placement="left"><DrawerOverlay /><DrawerContent><SidebarContent w="full" borderRight="none" /></DrawerContent></Drawer><Boxml={{base: 0,md: 60,}}transition=".3s ease"><Flexas="header"align="center"justify="space-between"w="full"px="4"bg="white"_dark={{bg: "gray.800",}}borderBottomWidth="1px"color="inherit"h="14"><IconButtonaria-label="Menu"display={{base: "inline-flex",md: "none",}}onClick={sidebar.onOpen}icon={<FiMenu />}size="sm"/><InputGroupw="96"display={{base: "none",md: "flex",}}><InputLeftElement color="gray.500"><FiSearch /></InputLeftElement><Input placeholder="Search for articles..." /></InputGroup><Flex align="center"><Icon color="gray.500" as={FaBell} cursor="pointer" /><Avatarml="4"size="sm"name="anubra266"src="https://avatars.githubusercontent.com/u/30869823?v=4"cursor="pointer"/></Flex></Flex><Box as="main" p="4">{/* Add content here, remove div below */}<Box borderWidth="4px" borderStyle="dashed" rounded="md" h="96" /></Box></Box></Box>);};
() => {const sidebar = useDisclosure();const NavItem = (props) => {const { icon, children, ...rest } = props;return (<Flexalign="center"px="4"mx="2"rounded="md"py="3"cursor="pointer"color="whiteAlpha.700"_hover={{bg: "blackAlpha.300",color: "whiteAlpha.900",}}role="group"fontWeight="semibold"transition=".15s ease"{...rest}>{icon && (<Iconmr="2"boxSize="4"_groupHover={{color: "gray.300",}}as={icon}/>)}{children}</Flex>);};const SidebarContent = (props) => (<Boxas="nav"pos="fixed"top="0"left="0"zIndex="sticky"h="full"pb="10"overflowX="hidden"overflowY="auto"bg="brand.600"borderColor="blackAlpha.300"borderRightWidth="1px"w="60"{...props}><Flex px="4" py="5" align="center"><Logo /><Text fontSize="2xl" ml="2" color="white" fontWeight="semibold">Choc UI</Text></Flex><Flexdirection="column"as="nav"fontSize="sm"color="gray.600"aria-label="Main Navigation"><NavItem icon={MdHome}>Home</NavItem><NavItem icon={FaRss}>Articles</NavItem><NavItem icon={HiCollection}>Collections</NavItem><NavItem icon={FaClipboardCheck}>Checklists</NavItem><NavItem icon={HiCode}>Integrations</NavItem><NavItem icon={AiFillGift}>Changelog</NavItem><NavItem icon={BsGearFill}>Settings</NavItem></Flex></Box>);return (<Boxas="section"bg="gray.50"_dark={{bg: "gray.700",}}minH="100vh"><SidebarContentdisplay={{base: "none",md: "unset",}}/><DrawerisOpen={sidebar.isOpen}onClose={sidebar.onClose}placement="left"><DrawerOverlay /><DrawerContent><SidebarContent w="full" borderRight="none" /></DrawerContent></Drawer><Boxml={{base: 0,md: 60,}}transition=".3s ease"><Flexas="header"align="center"justify="space-between"w="full"px="4"bg="white"_dark={{bg: "gray.800",}}borderBottomWidth="1px"borderColor="blackAlpha.300"h="14"><IconButtonaria-label="Menu"display={{base: "inline-flex",md: "none",}}onClick={sidebar.onOpen}icon={<FiMenu />}size="sm"/><InputGroupw="96"display={{base: "none",md: "flex",}}><InputLeftElement color="gray.500"><FiSearch /></InputLeftElement><Input placeholder="Search for articles..." /></InputGroup><Flex align="center"><Icon color="gray.500" as={FaBell} cursor="pointer" /><Avatarml="4"size="sm"name="anubra266"src="https://avatars.githubusercontent.com/u/30869823?v=4"cursor="pointer"/></Flex></Flex><Box as="main" p="4">{/* Add content here, remove div below */}<Box borderWidth="4px" borderStyle="dashed" rounded="md" h="96" /></Box></Box></Box>);};
Proudly developed in by Anuoluwapo Abraham