Skip to content

Icon 图标

Basic · Display component

Controlled icons and custom sources.

On-demand importwbbb-ui/components/icon

Basic Usage

Example code
<script setup lang="ts">
import { WbbbIcon } from 'wbbb-ui/components/icon'
import 'wbbb-ui/styles/icon'
</script>

<template>
  <WbbbIcon />
</template>
Live mobile previewOpen in a new tab ↗

States and Interaction

All listed states can be operated and verified in the live Playground preview.

DefaultContent

API Reference

Props

PropertyDescriptionTypeDefaultRequired
codeProvides the glyph code when rendering a font icon directly.string''No
colorSets the primary display color.string''No
fontFamilySets the font family used for a direct font icon.string''No
fontSetSelects a registered Iconfont set.string''No
nameProvides the item name or identifier.string''No
sizeSets the component size.WbbbNumeric32No
srcSets the source URL or local path of the resource.string''No

Events

None

Slots

None

Two-way binding

Does not support v-model.

Platform Notes

Build verification: H5, App Vue, WeChat Mini Program, Alipay Mini Program, and Douyin Mini Program.

Runtime differences: H5 supports keyboard focus and reduced motion. Mini Programs provide equivalent touch interaction; verify upload, date selection, and overlays on target platforms.

Usage note: Supports the 64-icon Lucide subset, image src, direct fontFamily + code, and registered fontSet + name sources.

Wbbb UI · Built for uni-app product experiences