LinkActive

A Next.js route link that puts an active boolean prop on the child if the link matches the current route path.

It implements the Next.js <Link> component.

Props

Use any valid <Link> props.

Examples

With the <LinkNav> and <Nav> components.
import { LinkActive, LinkNav, Nav } from 'device-agnostic-ui'

<Nav>
  <LinkActive href="/components/LinkActive" passHref>
    <LinkNav>LinkActive</LinkNav>
  </LinkActive>
  <LinkActive href="/components/LinkNav" passHref>
    <LinkNav>LinkNav</LinkNav>
  </LinkActive>
</Nav>