Link

Installation

Install the component via the CLI in one command. To install the required package, run the following command:

npm install react-aria-components

Anatomy

import { Link } from "@/components/ui/link"

<Link href="#basic">Label</Link>

Client side routing

Integrating Link with your framework’s link component is straightforward. Learn more in Client Side Routing.

Examples

Unstyled

By default, the link comes unstyled, making it easy to apply custom classes and styles.

Use as button

If you want to style a link to look like a button, you can do so by applying the buttonStyles prop.

Loading...

Disabled

You can disable the link by setting the isDisabled prop.

Label

Component API

The Link component navigates to another page or resource.

PropTypeDefault
classNamestring-

See the React Aria for the full API reference.