{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "link",
  "title": "Link",
  "type": "registry:ui",
  "files": [
    {
      "path": "packages/registry-react/components/link/Link.tsx",
      "content": "import * as React from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cn } from '@/lib/utils'\nimport { linkVariants, type LinkVariants } from './link.variants'\n\nexport interface LinkProps\n  extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'color'>,\n    LinkVariants {\n  /** External URL — renders an <a> with target/rel handling. */\n  href?: string\n  /** Router destination — renders an <a> since there is no vue-router in React.\n   *  Use asChild to render a Next.js <Link> or router-aware anchor instead. */\n  to?: string | object\n  as?: React.ElementType\n  /** Render the child element as the link (merging props/styles) instead of\n   *  emitting an <a> — the React equivalent of reka-ui's as-child. Use it to\n   *  give a Next.js <Link> full link styling. */\n  asChild?: boolean\n  /** Open external href in a new tab. Defaults to true for http(s) hrefs. */\n  external?: boolean\n  /** Leading icon — the React equivalent of the Vue #left slot. */\n  left?: React.ReactNode\n  /** Trailing icon — the React equivalent of the Vue #right slot. */\n  right?: React.ReactNode\n}\n\nconst Link = React.forwardRef<HTMLAnchorElement, LinkProps>(\n  (\n    {\n      className,\n      href,\n      to,\n      as: asProp = 'a',\n      asChild = false,\n      underline,\n      color,\n      size,\n      disabled,\n      external,\n      left,\n      right,\n      children,\n      ...props\n    },\n    ref,\n  ) => {\n    const isExternal =\n      external !== undefined\n        ? external\n        : typeof href === 'string' && /^https?:\\/\\//.test(href)\n\n    const resolvedHref = (to as string | undefined) ?? href\n\n    const externalAttrs = isExternal ? { target: '_blank', rel: 'noopener noreferrer' } : {}\n\n    const Comp = (asChild ? Slot : asProp) as React.ElementType\n\n    return (\n      <Comp\n        data-uipkge=\"\"\n        data-slot=\"link\"\n        data-underline={underline}\n        data-color={color}\n        data-size={size}\n        data-disabled={disabled ? '' : undefined}\n        href={resolvedHref}\n        aria-disabled={disabled ? 'true' : undefined}\n        tabIndex={disabled ? -1 : undefined}\n        className={cn(linkVariants({ underline, color, size }), disabled && 'pointer-events-none opacity-50', className)}\n        ref={ref}\n        {...externalAttrs}\n        {...props}\n      >\n        {asChild ? (\n          children\n        ) : (\n          <>\n            {left}\n            {children}\n            {right}\n          </>\n        )}\n      </Comp>\n    )\n  },\n)\nLink.displayName = 'Link'\n\nexport { Link }\n",
      "type": "registry:ui",
      "target": "~/components/ui/link/Link.tsx"
    },
    {
      "path": "packages/registry-react/components/link/link.variants.ts",
      "content": "import type { VariantProps } from 'class-variance-authority'\nimport { cva } from 'class-variance-authority'\n\nexport const linkVariants = cva(\n  \"inline-flex items-center gap-1.5 font-medium transition-colors duration-200 outline-none focus-visible:ring-ring/50 focus-visible:ring-[3px] rounded-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n  {\n    variants: {\n      underline: {\n        none: 'no-underline',\n        always: 'underline underline-offset-4',\n        hover: 'no-underline hover:underline hover:underline-offset-4',\n      },\n      color: {\n        default: 'text-foreground hover:text-foreground/80',\n        primary: 'text-primary hover:text-primary/80',\n        muted: 'text-muted-foreground hover:text-foreground',\n      },\n      size: {\n        sm: 'text-xs gap-1',\n        default: 'text-sm',\n        lg: 'text-base',\n      },\n    },\n    defaultVariants: {\n      underline: 'hover',\n      color: 'primary',\n      size: 'default',\n    },\n  },\n)\n\nexport type LinkVariants = VariantProps<typeof linkVariants>\n",
      "type": "registry:ui",
      "target": "~/components/ui/link/link.variants.ts"
    },
    {
      "path": "packages/registry-react/components/link/index.ts",
      "content": "export { Link, type LinkProps } from './Link'\nexport { linkVariants, type LinkVariants } from './link.variants'\n",
      "type": "registry:ui",
      "target": "~/components/ui/link/index.ts"
    }
  ],
  "dependencies": [
    "class-variance-authority",
    "@radix-ui/react-slot"
  ],
  "devDependencies": [],
  "registryDependencies": [],
  "description": "Styled anchor with router integration. Renders an <a> for href, a router-link for to, and handles external links with target/rel. Supports underline variants (always/hover/none), color variants (default/primary/muted), disabled state, left/right icon slots, size variants, and asChild composition.",
  "categories": [
    "navigation"
  ]
}