VDS

Alert

Site-wide priority notice bar with a dismiss control.

Installation

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

Packages are consumed via the workspace locally and are not published yet. See Installation for CSS setup.

Usage

React:

import { Alert } from "@vds-testing/react"
<Alert href="#">
  Optional site wide priority notice (Max characters TBC)
</Alert>

Web Components:

<script type="module">
  import "@vds-testing/elements";
</script>
<vds-alert href="#">
  Optional site wide priority notice (Max characters TBC)
</vds-alert>

Examples

When href is omitted, the label renders as plain text (not focusable). The close button remains available.

Anatomy

  • Alert / vds-alert — Full-width black notice bar (h-11 / 44px) with centered label (left-aligned on mobile) and a close control on the right
  • Label — Text link when href is set; uses vds-paragraph-s and focus-text
  • Close — Lucide X button using focus-shape

Props

Alert

Prop Type Default Description
href string - Turns the label into a text link
onDismiss () => void - Called when the close button is pressed (React)
class / className string - Additional CSS classes

Web Components use the href attribute on vds-alert. Closing dispatches a bubbling vds-alert-dismiss event.

Focus

  • Label link uses focus-text (yellow background, black underline shadow)
  • Close button uses focus-shape (yellow/black double ring)