Comments (3)
mdi-react
uses inline SVG which makes it kinda difficult or even impossible to create a generic Icon
component. For that an icon font or similar would be necessary.
I will close this for now.
But I'm curious: What's your use case you need a generic Icon
component for?
from mdi-react.
I wanted to create a custom button component with a couple things wrapped around a button. Currently I'm using a switch statement to select (from a small number of icons I need) the icon that appears in the button.
from mdi-react.
I would suggest you to add an icon prop which accepts a component instead of a string.
Quick example: https://codesandbox.io/s/rk8xnrnyn
from mdi-react.
Related Issues (20)
- Support TypeScript `module: node16`/`nodenext`
- Support tooltip display by passing a title child element
- Re-export all modules from an index.js file HOT 2
- Element type is invalid: expected a string (for built-in components) or a class/function but got: object HOT 3
- Is the 360 icon missing a corresponding component HOT 2
- Element type is invalid: expected a string HOT 3
- Module parse failed: Unexpected keyword 'var' HOT 4
- Update to mdi/svg 4.3.95 HOT 6
- Changelog is not friendly for developers deciding whether to upgrade HOT 1
- mdi-react-native HOT 6
- mdi-text-box icons are missing HOT 8
- Please specify entry point in package.json HOT 1
- Update to latest MDI HOT 4
- Prevent automatic icon resize
- Generate an index.js HOT 1
- HelpOutlineIcon looks exact like HandshakeOutlineIcon HOT 1
- Some icons not available HOT 4
- Dependency Dashboard
- package.json exports field support
- How to set title attribute on an icon? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mdi-react.