Keyboard shortcut: Ctrl + K
Get started

Iconography

Vectis UI includes SVG icons from Google’s Material Symbols Rounded collection (weight 400, GRAD 0, optical size 24, Apache 2.0 licence). You can also use your own SVGs, images, Vue components or icon fonts.

Built-in icons are separate modules. Your bundle includes the icons imported by your application and its components; importing VButton alone does not include the whole icon set.

The check_circle and notifications icons are shown in outline and filled forms.

Import an icon

Import icons from vectis-ui/icons. Pass the imported value to VIcon.name or an icon prop such as VButton.iconStart.

ts
import { close, search } from 'vectis-ui/icons'
vue
<!-- one of the design system's own icons, imported above -->
<VIcon :name="close" />

<!-- every icon prop takes the same value -->
<VButton :icon-start="search">Search</VButton>

<!-- a bare NAME: your resolver, then the icon font as a ligature -->
<VIcon name="favorite" />

A string such as "close" does not load a built-in SVG. It goes through your resolver, then falls back to an icon-font ligature. Import the icon value to include its SVG path.

Use your own icons

Register a resolver with setIconResolver to map icon names to your own graphics. The resolver takes priority over built-in paths. Use one of the helpers below or write a custom function.

Configure the resolver at application startup, in main.ts or a universal Nuxt plugin. Use the same configuration for SSR and hydration so the server and browser render matching icons.

Return undefined for names you do not handle. VIcon then uses the imported icon’s path, if present, or an icon-font ligature.

An unresolved name appears as clipped text if no matching icon font is loaded.

CSS classes

Load your icon library’s CSS, then use classIconResolver. Its className function receives the mapped name and the filled state, and returns the classes to apply.

ts
import { classIconResolver, setIconResolver } from 'vectis-ui'

// Font Awesome: the class names the icon, and the family carries the fill.
setIconResolver(
  classIconResolver({
    aliases: { close: 'xmark', search: 'magnifying-glass', expand_more: 'chevron-down' },
    className: (name, filled) => `${filled ? 'fa-solid' : 'fa-regular'} fa-${name}`,
  }),
)

strict defaults to true: built-in names without an alias return undefined, preserving their SVG fallback when available. Other names are passed to className, even without an alias.

Ligature fonts

Load a ligature font and set --vectis-font-family-icon. ligatureIconResolver renders each name as text for that font, with optional aliases.

ts
import { ligatureIconResolver, setIconResolver } from 'vectis-ui'

// The font must support every icon name.
setIconResolver(ligatureIconResolver())

// Add aliases for names that differ. Other names pass through unchanged.
setIconResolver(ligatureIconResolver({ aliases: { close: 'clear', more_horiz: 'more' } }))

This resolver handles every name and bypasses built-in SVG paths. Names without an alias pass through unchanged, so the font must support them.

Vue components

Use componentIconResolver to map names to imported Vue components. Each icon component must have a single <svg> root for sizing. The optional props function supplies component props.

ts
import { componentIconResolver, setIconResolver } from 'vectis-ui'
import { Check, Search, X } from '@lucide/vue'

setIconResolver(
  componentIconResolver({
    // Unmapped names use the imported SVG path or ligature fallback.
    components: { check: Check, close: X, search: Search },
    props: () => ({ strokeWidth: 1.75 }),
  }),
)

Names absent from components return undefined, allowing the imported SVG or ligature fallback.

Custom resolver

A resolver receives the icon name and a context containing filled. Return an IconRender object or undefined. This example resolves the documentation site’s icons:

ts
import { setIconResolver } from 'vectis-ui'

import { docsIcons } from '~/icons/icons'

// Return undefined to preserve the fallback for other names.
setIconResolver((name, context) => {
  const paths = docsIcons[name]
  if (!paths) return undefined
  return { path: (context.filled && paths[1]) || paths[0] }
})

Size

An icon uses the size set by its container, or 1em if none is set.

  • Set size in pixels on VIcon to override the inherited size.
  • Set --vectis-icon-size on a container to size the icons inside it.

Controls such as buttons set --vectis-icon-size according to their own size.

vue
<!-- 1em: the icon follows the text around it -->
<p>Ready <VIcon :name="check" /></p>

<!-- one icon, in pixels -->
<VIcon :name="check" :size="32" />

<!-- a context: every icon below is 20px unless it names its own -->
<div class="toolbar"><VIcon :name="check" /></div>

<style>
  .toolbar {
    --vectis-icon-size: 20px;
  }
</style>
The same icon at 16, 24 and 40 pixels.

Source priority

VIcon uses the first available source in this order:

  1. render: an IconRender object describing a path, component, image, text or CSS class.
  2. src: a non-empty image URL.
  3. name: resolved by your resolver, then by the imported icon’s SVG path if present, then as a font ligature.
  4. Default slot: used when no source is provided.
vue
<!-- an explicit render wins over everything else -->
<VIcon :render="{ src: '/logo.svg' }" label="Logo" />

<!-- an imported icon: your resolver is asked first, its own drawing answers next -->
<VIcon :name="close" />

<!-- a bare name: your resolver, then the ligature font -->
<VIcon name="favorite" />

<!-- nothing named at all: the slot is drawn -->
<VIcon><svg viewBox="0 0 24 24"><path d="…" /></svg></VIcon>

Strings in icon props such as iconStart are names, including identifiers such as mdi:close. Use an object for other sources: { src }, { component }, { path }, { text } or { class }. Pass these objects to VIcon.render when using VIcon directly.

Built-in icons

Import these icons from vectis-ui/icons, or use their names in your resolver’s alias table to replace them.

filled selects the filled path when one exists. Otherwise, the icon keeps its outline path.

  • add
  • arrow_downward
  • arrow_downward_alt
  • arrow_drop_down
  • arrow_drop_up
  • arrow_left_alt
  • arrow_right_alt
  • arrow_upward
  • arrow_upward_alt
  • attach_file
  • audio_file
  • calendar_today
  • check
  • check_circle
  • chevron_left
  • chevron_right
  • close
  • cloud_upload
  • code
  • colorize
  • description
  • error
  • expand_less
  • expand_more
  • first_page
  • folder_zip
  • image
  • inbox
  • info
  • last_page
  • more_horiz
  • notifications
  • open_in_new
  • picture_as_pdf
  • priority_high
  • remove
  • schedule
  • search
  • search_off
  • star
  • swap_vert
  • table_chart
  • video_file
  • warning