VDS

Button - Link

Text link with VDS focus state styling.

Installation

npm install @vds-testing/react @vds-testing/styles
npm install @vds-testing/elements @vds-testing/styles

See Installation for CSS setup.

Usage

React:

import { Link } from "@vds-testing/react"
<Link href="/docs">Documentation</Link>

Web Components:

<script type="module">
  import "@vds-testing/elements";
</script>
<vds-link href="/docs">Documentation</vds-link>

Examples

With left icon

With right icon

Disabled

Focus state

Link follows the global text-based focus state guidelines:

  • Yellow --color-yellow background
  • 3px black box-shadow at the bottom
  • Text color changes to black for contrast

Focus states are triggered by keyboard navigation (Tab key) and meet WCAG 2.2 contrast requirements.

Anatomy

  • Link - A single anchor element with slots for icons

Props

Prop Type Default Description
href string - Link destination
disabled boolean false Disables the link
class string - Additional CSS classes
leftIcon / rightIcon ReactNode - React only. Astro and Web Components use slot="left-icon" / slot="right-icon"