link-button

PreviousNext
Docs
kanpekiui

Preview

Loading preview…
registry/ui/link-button/index.tsx
"use client";

import type { VariantProps } from "cva";
import { composeRenderProps, Link } from "react-aria-components";
import { ButtonStyles } from "../button";

export interface LinkButtonProps
  extends React.ComponentProps<typeof Link>,
    VariantProps<typeof ButtonStyles> {}

export function LinkButton({
  className,
  variant,
  size,
  ...props
}: LinkButtonProps) {
  return (
    <Link
      className={composeRenderProps(className, (className) =>
        ButtonStyles({ className, size, variant })
      )}
      data-slot="link"
      {...props}
    />
  );
}

Installation

npx shadcn@latest add @kanpeki/link-button

Usage

import { LinkButton } from "@/components/ui/link-button"
<LinkButton />