Bridge UI

Icons

Plug an icon library into Bridge UI with the icon adapter.

Bridge UI does not ship a default icon set. Components that need icons—and the Icon component itself—accept either a concrete icon component or a semantic name resolved through an optional icon adapter on BridgeUIProvider (global.icons).

Bridge defines the IconAdapter interface: resolve and optional normalize. Ready factories ship in the separate @bridge-ui/adapters package under icon-* subpaths. Install it together with the matching icon library. The table below is the package list for each factory.

Import

import { SEMANTIC_ICON_NAMES, type IconAdapter } from "@bridge-ui/vue";
import { SEMANTIC_ICON_NAMES, type IconAdapter } from "@bridge-ui/react";

Examples

Pass an IconAdapter to global.icons. On Vue you can also use createBridgeUI(); in Astro, wire it once via appEntrypoint.

Each factory exports create*IconAdapter() and returns a plain IconAdapter. Use SEMANTIC_ICON_NAMES for the full name list at runtime; extend via TypeScript module augmentation (SemanticIconNameOverrides)—see Type overrides.

import { createLucideIconAdapter } from "@bridge-ui/adapters/vue/icon-lucide";

const icons = createLucideIconAdapter();
import { createLucideIconAdapter } from "@bridge-ui/adapters/react/icon-lucide";

const icons = createLucideIconAdapter();

Concrete components from any icon library still work without an adapter:

<Icon icon={AnyIconComponent} />
import type { IconAdapter, SemanticIconName } from "@bridge-ui/react";

const map = {
  /* …every SemanticIconName… */
} satisfies Record<SemanticIconName, unknown>;

const icons: IconAdapter = {
  resolve(name) {
    return map[name];
  },
};
Import Library Install
@bridge-ui/adapters/vue/icon-fontawesome Font Awesome 6 (free solid) @fortawesome/fontawesome-svg-core, @fortawesome/free-solid-svg-icons, @fortawesome/vue-fontawesome
@bridge-ui/adapters/vue/icon-heroicons Heroicons (24 outline) @heroicons/vue
@bridge-ui/adapters/vue/icon-lucide Lucide @lucide/vue
@bridge-ui/adapters/vue/icon-phosphor Phosphor Icons @phosphor-icons/vue
@bridge-ui/adapters/vue/icon-tabler Tabler Icons @tabler/icons-vue
Import Library Install
@bridge-ui/adapters/react/icon-fontawesome Font Awesome 6 (free solid) @fortawesome/fontawesome-svg-core, @fortawesome/free-solid-svg-icons, @fortawesome/react-fontawesome
@bridge-ui/adapters/react/icon-heroicons Heroicons (24 outline) @heroicons/react
@bridge-ui/adapters/react/icon-lucide Lucide lucide-react
@bridge-ui/adapters/react/icon-phosphor Phosphor Icons @phosphor-icons/react
@bridge-ui/adapters/react/icon-tabler Tabler Icons @tabler/icons-react

Some libraries (for example Font Awesome) pass native definitions instead of components. Those adapters provide normalize so both semantic names and raw definitions render. The Font Awesome adapter also exports wrapFaIcon when you need a component outside Icon.

API

Export / option Type Description
global.icons IconAdapter Provider option that enables semantic names app-wide.
IconAdapter.normalize (source: unknown) => unknown Optional transform for library-native values (e.g. Font Awesome).
IconAdapter.resolve (name: SemanticIconName) => unknown Maps a semantic name to an icon component (or native value).
SEMANTIC_ICON_NAMES readonly SemanticIconName[] Built-in semantic name list.
Tip

Missing entries in the map throw at resolve time. Map every name in SEMANTIC_ICON_NAMES (or your augmented set) before shipping.

Next steps

  • Icon — component API and sizing
  • Dates — date library adapter
  • i18n — translate Bridge chrome strings
  • Default props — other global provider options