Skip to content

Commit e88da5e

Browse files
committed
feat: added LinkWithArrow component for consistent animation across links with arrows
1 parent 4a142ba commit e88da5e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/components/ui/LinkWithArrow.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"use client";
2+
3+
import { cn } from "@/lib/utils";
4+
import { ArrowUpRight } from 'lucide-react'
5+
6+
7+
export default function LinkWithArrow({ className, href, children, ...props }: React.AnchorHTMLAttributes<HTMLAnchorElement>) {
8+
return (
9+
<a
10+
className={
11+
cn("group inline-flex items-center", className)
12+
}
13+
href={href}
14+
{...props}
15+
>
16+
{children}
17+
<ArrowUpRight className="w-4 h-4 md:w-5 md:h-5 transition-transform duration-300 group-hover:translate-x-1 group-hover:-translate-y-1"/>
18+
</a>
19+
);
20+
}

0 commit comments

Comments
 (0)