VDS

Button

Triggers actions and events.

Installation

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

See Installation for CSS setup.

Usage

React:

import { Button } from "@vds-testing/react"
<Button>Plan your visit</Button>

Web Components:

<script type="module">
  import "@vds-testing/elements";
</script>
<vds-button>Plan your visit</vds-button>

Examples

Secondary

With left icon

With right icon

Focus state

VDS buttons follow the global focus state guidelines for keyboard navigation:

  • Shape-based (default, secondary): Two concentric box-shadows — 3px yellow inner border with 3px black outer border.

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

Anatomy

  • Button - A single interactive element with slots for icons

Props

Button

Prop Type Default Description
variant default | secondary default Visual style variant
size xs | sm | default | lg | xl default Button size
iconOnly boolean false Square button for icon-only use
pill boolean false Renders with fully rounded corners
href string - Renders as anchor link
disabled boolean false Disables the button
class string - Additional CSS classes
leftIcon / rightIcon ReactNode - React only. Astro and Web Components use slot="left-icon" / slot="right-icon"