Skip to content

Action

Link

Navigates to a URL or route.

import { Link } from '@var-ui/react';

Link

Navigates to a URL or route. Renders React Aria’s Link, so it honours RouterProvider for client-side routing.

Examples

Default

Documentation
Demo.tsxTSX
import { Link } from '@var-ui/react';

<Link href="#">Documentation</Link>

A link inherits the surrounding font size, so it fits whatever sentence it sits in. For a standalone navigation link (“Back to runs”, “View raw”), set a size, a quieter tone (primary or secondary text instead of the accent link colour) and a startIcon or endIcon. Icons are sized to the text and hidden from assistive tech: the link text names the link. In Astro, pass the icon in the start-icon or end-icon slot.

Demo.tsxTSX
import { Link } from '@var-ui/react';

<Link href="/runs" tone="secondary" size="sm" startIcon="chevronLeft">
  Back to runs
</Link>

Props

Accessibility

Built on React Aria Components where applicable.