next-js-active-route
Version:
Active link component for Next.JS App Router, can be used in any component
28 lines (27 loc) • 725 B
TypeScript
import * as React from "react";
import { LinkProps } from "next/link";
import { ReactNode } from "react";
interface NavLinkProps extends LinkProps {
/**
* The URL the link should navigate to
*/
href: string;
/**
* The class name to apply when the link is active
*/
activeClassName: string;
/**
* Whether the link should be active only on exact matches
*/
exact?: boolean;
/**
* Additional class names to apply
*/
className?: string;
/**
* The content of the link
*/
children?: ReactNode;
}
declare const NavLink: ({ href, activeClassName, exact, className, children, ...props }: NavLinkProps) => React.JSX.Element;
export { NavLink };