`@unocss/preset-icons`: no corresponding CSS is generated when the icon attribute is passed to components through props.
See original GitHub issueI encapsulate an Icon component and pass the icon attribute with Vue props, but I don’t see the icon, finally, I find the CSS is not generated.
After many attempts, I find that only full icon value (It also includes comments. e.g. <!-- <div i="ion-settings-outline"> -->
) that appear in the current component can be detected and CSS generated accordingly.


Please click here for an example
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How To Customize React Components with Props
In this tutorial, you'll create custom components by passing props to your component. Props are arguments that you provide to a JSX element....
Read more >Test Renderer - React
This package provides a React renderer that can be used to render React components to pure JavaScript objects, without depending on the DOM...
Read more >React Components - W3Schools
Components can be passed as props , which stands for properties. Props are like function arguments, and you send them into the component...
Read more >Styles - React Select
Examples. Styles. React Select offers 3 main APIs for styling: The styles prop; The classNames prop; The classNamePrefix prop. The styles prop.
Read more >How to include a Font Awesome icon in React's render()
And finally, use the <FontAwesome /> component and pass in attributes to specify icon and styling: var MyComponent = React.createClass({ render: function ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
you’re trying to add vue bind to unocss attributify, you need to add them to safelist, or just map any used icon in the parent component (or in the component itself).
For example, I have this in the script setup:
and then I use the icon in the component (template)
Yeah, it’s just how UnoCSS works. https://github.com/unocss/unocss#scanning