Skip to content

Instantly share code, notes, and snippets.

@ravinggenius
Created August 30, 2025 18:04
Show Gist options
  • Save ravinggenius/c402d05ce90e63d97d9731f314e84b2f to your computer and use it in GitHub Desktop.
Save ravinggenius/c402d05ce90e63d97d9731f314e84b2f to your computer and use it in GitHub Desktop.
import classNames from "classnames";
import Link, { LinkProps } from "next/link";
import { AnchorHTMLAttributes, ComponentProps } from "react";
import styles from "./Anchor.module.scss";
export default function Anchor({
children,
className,
...linkProps
}: Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href"> &
LinkProps<string> & {
children: string;
className?: string;
}) {
return (
<Link
{...linkProps}
className={classNames(styles.anchor, className)}
>
{children}
</Link>
);
}
export type AnchorProps = ComponentProps<typeof Anchor>;
export type InternalHref = AnchorProps["href"];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment