How to use them#
The icons are in the @kvirn-ui/icons package. KvirnUI has no icons of its own to fall back on: you import the ones you use, so you ship only those (your bundle, the code you send to the browser). Pass an icon to the Icon component as icon, with or without a KvirnProvider:
import { search } from '@kvirn-ui/icons'
<Icon icon={search} />The icon gallery shows each name in kebab-case, such as chevron-down. The import is the same name in camelCase, such as chevronDown. Two names end in “Icon”, deleteIcon and newIcon, because delete and new are reserved words in JavaScript.
To use icons by name, register them once in KvirnProvider. You can also register icons from Lucide or another set there.
import { bus, cityHall } from '@kvirn-ui/icons'
const icons = defineIcons({ bus, 'city-hall': cityHall })
<KvirnProvider icons={icons}>
<Icon name="bus" />
</KvirnProvider>allIcons from @kvirn-ui/icons/all registers the whole set, but it adds every icon to your bundle. Register only the ones you need.
- An icon is decorative by default. Put it beside a word that says the same thing and leave the name out.
- Give it a
labelonly when it stands alone and carries meaning. Then draw it at 20 pixels or larger: 16 pixels is for decoration only. - With the
Iconcomponent, icons that point along the reading direction flip in right-to-left text. The icon gallery marks them. - Icons that stand alone, such as a status or a place, have a translated label. Get it with
useIconLabel; the icon gallery marks them. See the Icon page. - Variants such as
-add,-removeand-offshare their host drawing with the plain icon, and add a small badge or a slash. They are separate names, so pick one for its meaning, not its look.
Use them without KvirnUI#
The icons are free for any use, commercial and public-sector use included, under the MIT licence. The package depends on nothing else. Each icon is plain drawing data, so any app can use it. For React, @kvirn-ui/icons/react has a small SvgIcon component that works in a Server Component too (React is the only thing it needs):
import { search } from '@kvirn-ui/icons'
import { SvgIcon } from '@kvirn-ui/icons/react'
<SvgIcon icon={search} /> // decorative: hidden from screen readers
<SvgIcon icon={search} title="Search" /> // named: an image with an accessible nameKeep currentColor, the default, so the icon follows the text colour and high-contrast modes. Do not hard-code a fill or stroke.
SvgIcon does not flip icons in right-to-left text. Each icon says whether it should, and your code decides.
Limits#
The 421 icons are checked by automated tests. Before you launch, test that your users recognise the icons you use, have a native speaker review the labels you give them in each language you ship, and try them with your users’ assistive technology.