structured-render - v2.17.1
    Preparing search index...

    Function mapIconsByName

    • Creates an icons object for the icons option of RenderOptions, keyed by each icon's name rather than by the input object's keys. Reference an icon's key with iconMap.<IconName>.name.

      Type Parameters

      • const Icons extends Readonly<Record<string, ViraIconSvg>>

      Parameters

      Returns { [Icon in ViraIconSvg as Icon["name"]]: Icon }

      import {LucideCircleAlertIcon, LucideStarIcon} from 'vira';

      const icons = mapIconsByName({LucideCircleAlertIcon, LucideStarIcon});
      // {CircleAlert: LucideCircleAlertIcon, Star: LucideStarIcon}