link-button

PreviousNext
Docs
takiui

Preview

Loading preview…
registry/new-york/ui/link-button.tsx
"use client"

import {
  composeRenderProps,
  Link as RACLink,
  LinkProps as RACLinkProps,
} from "react-aria-components"
import { VariantProps } from "tailwind-variants"

import { buttonVariants } from "@/registry/new-york/ui/button"

export interface LinButtonProps
  extends RACLinkProps,
    VariantProps<typeof buttonVariants> {}

export function LinkButton(props: LinButtonProps) {
  return (
    <RACLink
      {...props}
      className={composeRenderProps(props.className, (className, renderProps) =>
        buttonVariants({ ...renderProps, className, variant: props.variant })
      )}
    />
  )
}

Installation

npx shadcn@latest add @taki/link-button

Usage

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