{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "line-hover-link", "type": "registry:ui", "dependencies": [], "files": [ { "path": "components/ui/line-hover-link.tsx", "content": "\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport { cn } from \"@/lib/utils\";\r\n\r\n/**\r\n * Line Hover Link Variants\r\n * \r\n * slide - Line slides in from right to left\r\n * double - Two lines animate with different timings\r\n * grow - Line grows thicker on hover\r\n * strike - Strikethrough effect with text scale\r\n * fade - Lines fade up with stagger delay\r\n * pulse - Line pulses up and down\r\n * swap - Two lines go opposite directions\r\n * sweep - Full background cover sweep\r\n * bounce - Bouncy squish animation\r\n * arc - SVG arc stroke draws in\r\n * scribble - SVG scribble stroke draws in\r\n */\r\nexport type LineHoverVariant =\r\n | \"slide\"\r\n | \"double\"\r\n | \"grow\"\r\n | \"strike\"\r\n | \"fade\"\r\n | \"pulse\"\r\n | \"swap\"\r\n | \"sweep\"\r\n | \"bounce\"\r\n | \"arc\"\r\n | \"scribble\";\r\n\r\nexport interface LineHoverLinkProps\r\n extends React.AnchorHTMLAttributes {\r\n /** The animation variant */\r\n variant?: LineHoverVariant;\r\n /** Link content */\r\n children: React.ReactNode;\r\n /** Additional CSS classes */\r\n className?: string;\r\n}\r\n\r\n/**\r\n * SVG Arc Graphic - draws an arc stroke on hover\r\n */\r\nconst ArcGraphic = () => (\r\n \r\n \r\n \r\n);\r\n\r\n/**\r\n * SVG Scribble Graphic - draws a scribble stroke on hover\r\n */\r\nconst ScribbleGraphic = () => (\r\n \r\n \r\n \r\n);\r\n\r\n/**\r\n * LineHoverLink Component\r\n * \r\n * A link component with beautiful underline hover animations.\r\n * Supports 11 different animation variants.\r\n * \r\n * @example\r\n * ```tsx\r\n * \r\n * Learn more\r\n * \r\n * ```\r\n */\r\nexport const LineHoverLink = React.forwardRef<\r\n HTMLAnchorElement,\r\n LineHoverLinkProps\r\n>(({ variant = \"slide\", children, className, ...props }, ref) => {\r\n // Variants that need span wrapper for text animation\r\n const needsSpan = [\"strike\", \"bounce\", \"arc\", \"scribble\"].includes(variant);\r\n\r\n // Variants that need SVG graphics\r\n const svgVariant =\r\n variant === \"arc\" ? \"arc\" : variant === \"scribble\" ? \"scribble\" : null;\r\n\r\n return (\r\n \r\n {needsSpan ? {children} : children}\r\n {svgVariant === \"arc\" && }\r\n {svgVariant === \"scribble\" && }\r\n \r\n );\r\n});\r\n\r\nLineHoverLink.displayName = \"LineHoverLink\";\r\n\r\nexport default LineHoverLink;\r\n", "type": "registry:ui", "target": "components/ui/line-hover-link.tsx" } ] }