@chakra-ui/core#SlideIn JavaScript Examples

The following examples show how to use @chakra-ui/core#SlideIn. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.js    From here-covid-19-tracker with MIT License 5 votes vote down vote up
AboutModal = () => {
  const { isOpen, onOpen, onClose } = useDisclosure()
  const btnRef = useRef()

  return (
    <Box flex="none" display={["none", null, "block"]} ml="0.75rem">
      <IconButton
        size="lg"
        icon="info"
        isRound
        variant="outline"
        bg="white"
        shadow="lg"
        border="0.125rem solid"
        borderColor="transparent"
        _focus={{
          borderColor: "rgba(236,97,14, 1)",
          color: "rgba(236,97,14, 1)"
        }}
        onClick={onOpen}
        ref={btnRef}
      />

      <SlideIn in={isOpen}>
        {styles => (
          <Modal 
            finalFocusRef={btnRef}
            onClose={onClose}
            scrollBehavior="inside"
            isOpen={true}
            size={["calc(100% - 2rem)", null, "2xl"]}
          >
            <ModalOverlay opacity={styles.opacity} zIndex={99999999} />
            <ModalContent borderRadius="lg" {...styles} zIndex={99999999}>
              <ModalCloseButton />
              <ModalBody py="3rem" px="2.5rem">
                <AboutContent />
              </ModalBody>
            </ModalContent>
          </Modal>
        )}
      </SlideIn>

    </Box>
  )
}