Skip to content

Draws an icon from an Iconify collection or from one of your own SVG files. For previews and autocomplete with BbIcon, use the Iconify extension.

import { BbIcon } from 'bitboss-ui';

On this page

Use it for

Reach for BbIcon when the icon is part of the design: a status in a table cell, empty-state art, a list marker.

Use something else when

Pass Through

Hover or tap a part to outline it. Toggles flip loading, errors and warnings when the component has them — only parts highlight.

Default

Pass the icon name to icon. It is the only required prop.

Coming from v2type → icon

The prop was called type in v2. A template still passing type fails at mount.

Names

icon takes provider:icon, for example lucide:check. For your own SVGs use local:my-icon (the local: prefix is optional but recommended).

Install the collections you want and the plugin finds them:

bash
npm install -D @iconify-json/lucide
lucide:heart
local:heart
local:whatsapp
whatsapp

If you write a name that does not exist the app stops at mount, and in development the overlay tells you which npm install you are missing. The Iconify extension for VS Code previews icons as you type.

You can also import your own SVGs as strings and pass them straight to icon (only markup you control: the library does not sanitize it).

vue
<script setup lang="ts">
import mark from '~/assets/marks/partner.svg?raw';
</script>

<template>
    <BbIcon :icon="mark" size="2xl" />
</template>

Sizes

Sizes run from xs to 2xl, md (24px) is the default.

Coming from v2xxl → 2xl

The largest key is now 2xl.

Color

Icons inherit the text color wherever they sit.

  • Payment declined
  • Shipped this morning
  • Not processed yet
Coming from v2color removed

color="#6b7280" becomes a class or a token on the parent. Inside BbButton, BbBadge or BbAlert you need do nothing: the icon already takes the right color.

Accessible name

Add label when the icon is the only thing saying something: it gets role="img" and that text as its name. Leave it off when the text is already beside it, or screen readers read it twice.

Two-factor authentication
Billing
Card ending 4242

label does not produce a tooltip. Add v-bb-tooltip if you want a visible one.

When you do not need it

Most components take the icon name on a prop and place it themselves. Hand-placing a BbIcon inside them is the most common mistake with this component.

Paid

The exceptions are components with no icon field, where you pass a BbIcon in a slot: BbTabs, BbBreadcrumbs, BbRating, BbSwitch and BbAvatar.

  • ORD-2026-0496Pending
  • ORD-2026-0474Processing
  • ORD-2026-0447Shipped
  • ORD-2026-0417Delivered
  • ORD-2026-0435Cancelled
  • ORD-2026-0421Refunded