Icons
VD3 UI includes Phosphor Icons — a flexible icon family with 1,500+ icons in 6 weights. Icons are bundled locally with no external dependencies.
Icon Weights
6 distinct weights for different visual styles:
Note:@vanduo-oss/vd3/css loads the regular and fill weights. Bold, light, thin, and duotone glyphs are not in the published package. Prefer regular and fill in apps. See Import Options below.
Quick Start
Include the icons stylesheet and use <i> elements with the appropriate classes:
Import Options
Example Icons
Styling Icons
Icons are font-based — style them with CSS:
Icons in Buttons
Icons by Phosphor Icons — MIT Licensed
Accessibility
Phosphor icons render as empty <i> elements (the glyph is a font), so they carry no text for assistive tech. Two rules cover every case:
aria-hidden="true"; the label already speaks for it. aria-label="…". <!-- Decorative: label is visible, hide the icon -->
<button class="vd-btn vd-btn-primary">
<i class="ph ph-download-simple" aria-hidden="true"></i> Download
</button>
<!-- Icon-only: give the control an accessible name -->
<button class="vd-btn" aria-label="Close dialog">
<i class="ph ph-x" aria-hidden="true"></i>
</button>Also mind touch targets: keep icon-only controls at least 24×24px (WCAG 2.2). More in Accessibility Essentials.
VdIcon (Vue 3)
Prefer the VdIcon component when you want typed props instead of raw Phosphor classes:
<script setup lang="ts">
import { VdIcon } from "@vanduo-oss/vd3";
</script>
<template>
<VdIcon name="rocket" />
<VdIcon name="heart" filled size="lg" />
</template>Component API
| Prop | Description |
|---|---|
:name | Phosphor icon name without the ph- prefix (e.g. "rocket"). |
:filled | Use the filled icon weight. |
:size | sm | md | lg (default md). |