Iconography
Orvain UI has one icon set, @orvain/icons: 633 outline icons shared by the React and Vue packages. The full set comes with Pro. Each icon is its own module, so your bundle carries only the icons you import.
Style#
- One style: outline. There are no filled or duotone variants to mix up.
- Drawn on a 24px grid with a 1.5px stroke and round caps and joins.
- Drawn in
currentColor, so an icon takes the colour of the text around it. Set the colour on the parent, not on the icon. - Drawn at 24px by default. Components size their own icons: 20px in fields, 16 to 18px in compact controls.
The set#
A preview of everyday icons. The other 585 come with Pro.
All 633 icons come with ProPro
See plansClick an icon to copy its import name.
Using icons#
Every component prop that takes an icon accepts a definition imported from @orvain/icons. Only the icons you import are bundled, and nothing needs registering:
Slots that take any content, such as an input's leading icon, take an icon you draw yourself. A definition is plain data (name, viewBox and body), so a small component draws it:
Icons by name#
Icon props also take a name such as "bell-ring", for icons that arrive as data from a CMS or a config file. A name draws only once its icon is registered, so register the ones you use once, in your entry file:
icon={iconBellRing})registerIcons(…)import "@orvain/icons/all"Names are typed: IconName lists every built-in name, so a typo fails to compile. Your own icon works the same way: pass { name, viewBox, body } as a definition, or register it to use it by name.
Accessibility#
Icons inside components are hidden from screen readers, because the component's label already says what it does. An icon that stands alone and carries meaning, such as an icon-only button, needs a label on the button:
- Decorative icons are
aria-hidden. Don't give them a title. - An icon with no text next to it gets its label from the control, not from the icon.
- Meaning never rests on an icon's colour alone: an error icon comes with error text.
Logos, flags and artwork#
Icons are one colour on purpose. Brand logos, country flags, file-type badges, emoji and the empty-state illustrations are multicolour, so they live in @orvain/assets, which the React and Vue packages already depend on. The colour tokens they sit on are in Color.
Icon set from @orvain/icons 0.1.4.
