The library is still in early development. Breaking changes and bugs may occur without prior notice. Thanks for your interest in using the library!

Search

Link

Source

A versatile component for navigation and interaction.

Usage

Import the Link component from @bun-ui/react and use it in your project:

import { Link } from "@bun-ui/react"
<Link href="#">Visit Example</Link>

Examples

Custom Rendering

The Link component supports rendering as a custom child element using the asChild prop. This is useful for integrating with other components like buttons.

Underline

Accessibility

The Link component is built with accessibility in mind. Ensure that links have descriptive labels and are keyboard-navigable. Use the aria-* attributes where necessary to provide additional context.

<Link href="/" aria-label="Go to homepage">
  Home
</Link>

Customization

The Link component can be customized using the className prop or by extending its styles with your design system.

<Link href="#" className="text-blue-500 underline hover:text-blue-700">
  Custom Styled Link
</Link>