Layout & primitives
Icon
Free14.2 KB gzippedInline SVG icon. Render a built-in icon with name, or pass your own SVG content as children. Decorative by default (hidden from assistive technology); pass label when the icon conveys meaning on its own.
Accessibility: WCAG 2.2 AA · No A or AA violations in light or dark mode · No keyboard interaction of its own · Full report
Import
import { Icon, AccessibilityIcon } from "@vjdesigns/vjdesigns-ui";
Importing only Icon adds about 14.2 KB of minified, gzipped JavaScript to your app (React not included). The stylesheet is shared by every component and loaded once: 75.1 KB gzipped.
Examples
Sizes and tones
Every icon is its own component. They're decorative (hidden from screen readers) unless you give them a label.
import {
CheckIcon,
Flex,
HeartFilledIcon,
Stack,
StarIcon,
WarningIcon,
} from "@vjdesigns/vjdesigns-ui";
export function SizesAndTones() {
return (
<Stack gap={4} align="center">
<Flex gap={4} align="center">
<StarIcon size="xs" />
<StarIcon size="sm" />
<StarIcon size="md" />
<StarIcon size="lg" />
<StarIcon size="xl" />
</Flex>
<Flex gap={4} align="center">
<CheckIcon tone="success" size="lg" />
<WarningIcon tone="warning" size="lg" />
<HeartFilledIcon tone="danger" size="lg" />
<StarIcon tone="primary" size="lg" />
<StarIcon tone="muted" size="lg" />
</Flex>
</Stack>
);
}
Meaningful
Give an icon a label when it carries meaning on its own. spin rotates it (and respects reduced motion).
Jordan Lee
import { CheckIcon, Flex, LoaderIcon, Text } from "@vjdesigns/vjdesigns-ui";
export function Meaningful() {
return (
<Flex gap={6} align="center">
<Flex gap={2} align="center">
<CheckIcon tone="success" label="Verified" />
<Text>Jordan Lee</Text>
</Flex>
<LoaderIcon spin label="Loading" />
</Flex>
);
}
By name
Icon with a name picks an icon by string, which is handy when the icon comes from data.
Events
Messages
Settings
import { Flex, Icon, Text } from "@vjdesigns/vjdesigns-ui";
export function ByName() {
const items = [
{ icon: "calendar", label: "Events" },
{ icon: "mail", label: "Messages" },
{ icon: "settings", label: "Settings" },
] as const;
return (
<Flex gap={6} wrap="wrap">
{items.map((item) => (
<Flex key={item.label} gap={2} align="center">
<Icon name={item.icon} tone="primary" />
<Text>{item.label}</Text>
</Flex>
))}
</Flex>
);
}
Accessibility
Icons are decorative unless you give them a label; then they get role="img" and that name. Here the warning icon carries meaning on its own, while the check icon sits beside text that already says it.
3 invoices are overdue.
Payment received
import {
CheckIcon,
Flex,
Stack,
Text,
WarningIcon,
} from "@vjdesigns/vjdesigns-ui";
export function Accessibility() {
return (
<Stack gap={3}>
<Flex align="center" gap={2}>
<WarningIcon tone="warning" label="Warning" />
<Text>3 invoices are overdue.</Text>
</Flex>
<Flex align="center" gap={2}>
<CheckIcon tone="success" />
<Text>Payment received</Text>
</Flex>
</Stack>
);
}
Accessibility icons
Accessibility icons mark accessibility features and services. labeled gives each one a built-in name (here "Wheelchair accessible", "Hearing loop", "Sign language" and "Audio description"), so you don't write or translate it yourself. Without labeled or label they're decorative, like the others.
Transcript available
import {
AudioDescriptionIcon,
Flex,
HearingLoopIcon,
SignLanguageIcon,
Text,
TranscriptIcon,
WheelchairIcon,
} from "@vjdesigns/vjdesigns-ui";
export function AccessibilityIcons() {
return (
<Flex gap={6} align="center" wrap="wrap">
<WheelchairIcon size="lg" labeled />
<HearingLoopIcon size="lg" labeled />
<SignLanguageIcon size="lg" labeled />
<AudioDescriptionIcon size="lg" labeled />
<Flex gap={2} align="center">
<TranscriptIcon tone="primary" />
<Text>Transcript available</Text>
</Flex>
</Flex>
);
}
Accessibility icon by name
AccessibilityIcon picks one by name, for icons that come from data, such as a venue's list of services.
import { AccessibilityIcon, Flex } from "@vjdesigns/vjdesigns-ui";
export function AccessibilityIconByName() {
const services = ["ramp", "elevator", "braille", "screen-reader"] as const;
return (
<Flex gap={6} align="center" wrap="wrap">
{services.map((name) => (
<AccessibilityIcon key={name} name={name} size="lg" tone="primary" labeled />
))}
</Flex>
);
}
Accessibility icons translated
The built-in names come in every bundled language: inside a French LocaleProvider, the wheelchair icon is read as "Accessible en fauteuil roulant". Icons that show movement face the reading direction, so the wheelchair, ramp and blind icons mirror in right-to-left layouts.
import {
BlindIcon,
Flex,
RampIcon,
Stack,
WheelchairIcon,
LocaleProvider,
} from "@vjdesigns/vjdesigns-ui";
import ar from "@vjdesigns/vjdesigns-ui/locales/ar";
import fr from "@vjdesigns/vjdesigns-ui/locales/fr";
export function AccessibilityIconsTranslated() {
return (
<Stack gap={4}>
<LocaleProvider locale="fr" messages={fr}>
<Flex gap={4} align="center">
<WheelchairIcon size="lg" labeled />
<RampIcon size="lg" labeled />
<BlindIcon size="lg" labeled />
</Flex>
</LocaleProvider>
<LocaleProvider locale="ar" messages={ar}>
<Flex gap={4} align="center">
<WheelchairIcon size="lg" labeled />
<RampIcon size="lg" labeled />
<BlindIcon size="lg" labeled />
</Flex>
</LocaleProvider>
</Stack>
);
}
Translated
An icon's label is your own text, so translate it with the page; LocaleProvider sets lang so it's read in French.
3 factures sont en retard.
import {
Flex,
Text,
WarningIcon,
LocaleProvider,
} from "@vjdesigns/vjdesigns-ui";
import fr from "@vjdesigns/vjdesigns-ui/locales/fr";
export function Translated() {
return (
<LocaleProvider locale="fr" messages={fr}>
<Flex align="center" gap={2}>
<WarningIcon tone="warning" label="Attention" />
<Text>3 factures sont en retard.</Text>
</Flex>
</LocaleProvider>
);
}
All icons
75 icons and 20 accessibility icons, each exported as its own component. Select one to copy its JSX.
Accessibility icons
For accessibility features and services. Add labeled for a built-in name in every bundled language.
Interface icons
API reference
Icon
| Prop | Type | Default |
|---|---|---|
nameBuilt-in icon to render. Takes precedence over | IconName | — |
childrenCustom SVG content on a 24x24 grid (pass | ReactNode | — |
sizeSize: | IconSize | — |
toneColor. Defaults to | "neutral""primary""accent""success""warning""danger""info""inherit""muted" | — |
strokeWidthStroke width on the 24x24 grid. Applies to stroke-based icons. | number | — |
labelAccessible name. When set, the icon is meaningful ( | string | — |
spinRotates the icon continuously (for | boolean | — |
Also accepts standard HTML attributes, plus className, style and ref.
AccessibilityIcon
New in 3.9.0Icons for accessibility features and services: wheelchair access, audio description and transcripts, hearing loops, sign language, display settings, and alternative input. (Captions are Icon name="captions".) Same props as Icon, plus labeled, which turns on a built-in accessible name in every bundled language. Decorative by default.
Drawn to stricter rules than the main set, all checked on every release: readable at 16px, never mistakable for another icon at that size, inside a safe area, and painted only with currentColor so tones, dark mode, and Windows High Contrast recolor them. Icons that show movement (wheelchair, ramp, blind) mirror in right-to-left layouts. Use them at 16px (sm) or larger.
| Prop | Type | Default |
|---|---|---|
nameRequiredAccessibility icon to render. | AccessibilityIconName | — |
labeledGive the icon its built-in accessible name, translated by | boolean | — |
sizeSize: | IconSize | — |
toneColor. Defaults to | "neutral""primary""accent""success""warning""danger""info""inherit""muted" | — |
strokeWidthStroke width on the 24x24 grid. Applies to stroke-based icons. | number | — |
labelAccessible name. When set, the icon is meaningful ( | string | — |
spinRotates the icon continuously (for | boolean | — |
Also accepts standard HTML attributes, plus className, style and ref.
See what changed in each version in the Changelog.
Accessibility report
Icon targets WCAG 2.2 AA. Below: a live axe-core audit of this page's examples, Lighthouse scores for the page in both modes, the accessibility behavior built into the component, and the checks only a person can do.
axe-core audit (live)
Checking the examples above…
Lighthouse audit
Light mode
Score 10038 passed · 0 failed · 27 not applicable · 10 to check by hand
Dark mode
Score 10038 passed · 0 failed · 27 not applicable · 10 to check by hand
Lighthouse 13.5.0 audits the whole docs page (header and sidebar included), not just the examples, in English. Last run 11/27/2026. Some failed audits carry no weight in the score, so a page can score 100 and still list one.
Built-in behavior
Keyboard
Not focusable, so there's no keyboard interaction of its own.
Roles and states
| Element | Role | States and properties |
|---|---|---|
<svg> (default) | none | aria-hidden="true": decorative |
<svg> with label | img | aria-label |
Accessibility icon <svg> with labeled | img | aria-label: its built-in name from LocaleProvider ("Wheelchair accessible"); label wins when both are set |
Manual checks
Automated tools find roughly a third of accessibility issues. Test these in your app, with your content.
| Check | What to test | WCAG 2.2 |
|---|---|---|
| Keyboard | Every action works with Tab, Shift+Tab, Enter, Space and the arrow keys, and focus never gets stuck. | 2.1.1 (A), 2.1.2 (A) |
| Focus | Focus moves in a logical order, is always visible, and isn't hidden behind sticky headers. | 2.4.3 (A), 2.4.7 (AA), 2.4.11 (AA), 2.4.13 (AAA) |
| Screen readers | Names, roles and states are announced correctly, and status changes are announced without moving focus. | 1.3.1 (A), 4.1.2 (A), 4.1.3 (AA) |
| Color | Meaning never depends on color alone; your own colors meet contrast in both modes. | 1.4.1 (A), 1.4.3 (AA), 1.4.11 (AA), 1.4.6 (AAA) |
| Zoom and reflow | At 200% text size and at 320px wide (400% zoom), nothing is cut off and no sideways scrolling is needed. | 1.4.4 (AA), 1.4.10 (AA), 1.4.12 (AA) |
| Pointer targets | Click and tap targets are at least 24×24px (44×44px for AAA), or spaced so they don't overlap. | 2.5.8 (AA), 2.5.5 (AAA) |
| Motion | Animations respect the reduced-motion setting. | 2.3.3 (AAA) |