@chakra-ui/react#LinkProps TypeScript Examples

The following examples show how to use @chakra-ui/react#LinkProps. 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: _app.tsx    From graphql-mesh with MIT License 6 votes vote down vote up
LinkNewTabIfExternal = (props: LinkProps & NextLinkProps) => {
  return props.href.startsWith('/') ? (
    // @ts-expect-error type incompatibility
    <Link {...props} color="accentColor" sx={{ '&:hover': { textDecoration: 'none' } }} />
  ) : (
    <>
      {/* @ts-expect-error type incompatibility */}
      <Link {...props} isExternal={true} color="accentColor" sx={{ '&:hover': { textDecoration: 'none' } }} />{' '}
      <ExternalLinkIcon />
    </>
  );
}
Example #2
Source File: Link.tsx    From website with MIT License 6 votes vote down vote up
Link: React.FC<LinkProps> = ({ children, href }) => (
  <BaseLink
    href={href}
    isExternal
    borderBottom="1px solid"
    borderBottomColor="gray.400"
    backgroundColor="#a8d8fc80"
    _hover={{ backgroundColor: '#a8d8fc', borderBottomColor: 'gray.800' }}
  >
    {children}
  </BaseLink>
)
Example #3
Source File: LinkButton.tsx    From website with MIT License 6 votes vote down vote up
LinkButton: React.FC<LinkProps> = ({ children, ...props }) => (
  <Link
    display="grid"
    padding="0 16px"
    height="40px"
    _hover={{ backgroundColor: '#0000001a' }}
    gridAutoFlow="column"
    gridAutoColumns="max-content"
    justifyContent="center"
    alignItems="center"
    width="max-content"
    borderRadius="4px"
    {...props}
  >
    <Text>{children}</Text>
    <ArrowForwardIcon size="21px" ml="8px" />
  </Link>
)