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:149