Skip to content

useIcons

Overview

A hook to get the icon entry for a given icon name within a component's icon slots. Returns null if no entry is registered for the requested slot.

When props (carrying ICON_OVERRIDE_PROPS) is supplied, the component's own iconOverride prop is folded into the merged override (ancestor + self) and provided to descendants, so the component's own icons honor its prop. Mirrors useTheme / useThemeOverride: Vue inject cannot observe a same-component provide, so the merged ref returned by useIconsOverride is consumed directly. Without props, resolution reads the injected ancestor override as before.

Signature

useIcons(componentName, props)

Parameters

NameTypeRequiredDescription
componentNamestringyesThe name of the component.
propsobjectnoReactive props carrying iconOverride (from ICON_OVERRIDE_PROPS).

props Properties

NameTypeRequiredDefaultDescription
iconOverrideIconRegistry

Returns

UseIconsReturnFunction

Source

client/lib/use/useIcons.js:145

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2