Star on GitHub

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.
Pair an icon with a label wherever there is room. An icon on its own is only clear for a handful of actions everyone knows, such as close, search and more.

The set#

A preview of everyday icons. The other 585 come with Pro.

All 633 icons come with ProPro

See plans

Click 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:

import { DropdownField, SelectOption } from "@orvain/react";
import { iconUser, iconSettings } from "@orvain/icons";
<DropdownField label="Go to">
<SelectOption value="profile" label="Profile" icon={iconUser} />
<SelectOption value="settings" label="Settings" icon={iconSettings} />
</DropdownField>

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:

// OrvainIcon.tsx
import type { IconDefinition } from "@orvain/icons";
export function OrvainIcon({ icon, size = 24, title }: { icon: IconDefinition; size?: number; title?: string }) {
return (
<svg
viewBox={icon.viewBox} width={size} height={size} fill="none"
strokeWidth={1.5} strokeLinecap="round" strokeLinejoin="round"
role={title ? "img" : undefined} aria-label={title} aria-hidden={title ? undefined : true}
dangerouslySetInnerHTML={{ __html: icon.body }}
/>
);
}
// <Input label="Search" leadingIcon={<OrvainIcon icon={iconSearch} size={20} />} />

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:

main.ts
import { registerIcons, iconBellRing, iconCheckCircle } from "@orvain/icons";
registerIcons(iconBellRing, iconCheckCircle);
// or every icon, about 100 KB gzipped:
// import "@orvain/icons/all";
SetupIn your bundleNames draw
Definitions only (icon={iconBellRing})
Only those icons
Not needed
registerIcons(…)
The icons you register, about 0.2 KB each
Yes, server-side too
import "@orvain/icons/all"
Every icon, about 100 KB
Yes, server-side too
Nothing registered
No icons
No: an empty icon and a warning in development

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:

Icon-only button
<button type="button" aria-label="Delete file">
<OrvainIcon icon={iconTrash} size={20} />
</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.