Copy to clipboard
<Alert href="#">
Optional site wide priority notice (Max characters TBC)
</Alert>
<Alert href="#">
Optional site wide priority notice (Max characters TBC)
</Alert><Alert href="#">
Optional site wide priority notice (Max characters TBC)
</Alert>
Installation
pnpm install @vds-testing/react @vds-testing/stylespnpm install @vds-testing/elements @vds-testing/stylesPackages 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
Without link
When href is omitted, the label renders as plain text (not focusable). The close button remains available.
Copy to clipboard
Optional site wide priority notice (Max characters TBC)
<Alert>
Optional site wide priority notice (Max characters TBC)
</Alert>
<Alert>
Optional site wide priority notice (Max characters TBC)
</Alert><Alert>
Optional site wide priority notice (Max characters TBC)
</Alert>
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
hrefis set; usesvds-paragraph-sandfocus-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)