Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic icon element #36

Closed
AustinErck opened this issue Jun 14, 2018 · 3 comments
Closed

Generic icon element #36

AustinErck opened this issue Jun 14, 2018 · 3 comments
Labels

Comments

@AustinErck
Copy link

Add a generic Icon component that takes a prop called icon which allows us to dynamically change the icon based on a string.

@levrik levrik added the wontfix label Jun 14, 2018
@levrik
Copy link
Owner

levrik commented Jun 14, 2018

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?

@levrik levrik closed this as completed Jun 14, 2018
@AustinErck
Copy link
Author

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.

@levrik
Copy link
Owner

levrik commented Jun 17, 2018

I would suggest you to add an icon prop which accepts a component instead of a string.
Quick example: https://codesandbox.io/s/rk8xnrnyn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants