Skip to content

How to handle dynamic icons or icon names? #267

@9uenther

Description

@9uenther

I want to pass the names dynamically. But if they have not been loaded before, the icon does not appear.

<UIcon :name="myDynamicIcon" />
const myDynamicIcon = ref('i-mdi-file-tree');

Is it possible to use an IconifyIcon object like this?

import { getIcon } from '@iconify/vue';
const myDynamicIcon = ref(getIcon('i-mdi-file-tree'));

Docs: https://iconify.design/docs/icon-components/vue/get-icon.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions