Integrate with Vue
Install and use Univer Icons in Vue 3 projects.
Add icons to a Vue 3 interface, then adjust their size and colors to match the surrounding controls.
Install the package
Install the icon package in a Vue 3 project:
pnpm add @univerjs/icons-vuenpm install @univerjs/icons-vueyarn add @univerjs/icons-vuebun add @univerjs/icons-vueAdd an icon to a button
Select a component in the icon preview and import it by name. The copy button below keeps a text label next to its icon.
<script setup lang="ts">import { CopyIcon } from '@univerjs/icons-vue'const emit = defineEmits<{ copy: [] }>()</script><template> <button type="button" @click="emit('copy')"> <CopyIcon aria-hidden="true" /> <span>Copy</span> </button></template>Handle the copy event in the parent component. The icon is decorative because the visible text already names the action.
Set size and color
An icon inherits its color from the surrounding text and its size from 1em. Set fontSize and color on the icon to override either value:
<script setup lang="ts">import { AddImageIcon } from '@univerjs/icons-vue'</script><template> <AddImageIcon aria-hidden="true" :style="{ fontSize: '20px', color: '#27272a' }" /></template>Set both colors of a two-color icon
A two-color icon uses color for its main color and extend.colorChannel1 for its accent. The example below pairs dark gray with a light gray accent:
<script setup lang="ts">import { PaintBucketDoubleIcon } from '@univerjs/icons-vue'</script><template> <PaintBucketDoubleIcon aria-hidden="true" :style="{ fontSize: '20px', color: '#27272a' }" :extend="{ colorChannel1: '#d4d4d8' }" /></template>Multicolor icons, including brand logos, may come with fixed colors. These settings do not replace every color in such icons.
Keep strokes thin when enlarging icons
If an enlarged icon appears too heavy, use preserveStrokeWidth. Strokes that support it keep the width they have at 16 × 16, and filled shapes are unaffected. Check the result with the stroke control in the preview before applying it.
<script setup lang="ts">import { ShapePieIcon } from '@univerjs/icons-vue'</script><template> <ShapePieIcon aria-hidden="true" preserve-stroke-width style="font-size: 48px" /></template>Give icon-only buttons a name
When a button has no visible text, add aria-label="Copy" to the button and keep aria-hidden="true" on the icon so that screen readers can announce the action.
To have an AI Agent find the icon and write the integration code, connect MCP.
How is this guide?