Link

Installation

Add the component with the CLI. 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

To use Link with your router’s link component, see Client Side Routing.

Examples

Unstyled

Links are unstyled by default. Apply classes through className.

Use as button

Apply buttonStyles to the link’s className to style it as a button.

Loading...

Disabled

You can disable the link by setting the isDisabled prop.

Label

Component API

Link extends the React Aria Components <Link> component.

classNamestring

See the React Aria for the full API reference.

Design