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

Make an Octicons component #2

Closed
broccolini opened this issue Feb 20, 2018 · 2 comments
Closed

Make an Octicons component #2

broccolini opened this issue Feb 20, 2018 · 2 comments

Comments

@broccolini
Copy link
Member

In use this might look like <Icon alert />.

This article seems to provide a good approach: http://nicolasgallagher.com/making-svg-icon-libraries-for-react-apps/

@jonrohan
Copy link
Member

<Icon alert />

I'm not aware this is valid. In the article he suggests <Icon name='camera' /> Could you provide some examples of components that have properties like this so I can understand how they work?

@broccolini
Copy link
Member Author

An example of this approach would be buttons, we have props for small and large so that we can do things like the following:

https://github.com/primer/primer-react/blob/0f251ca2cf121c2c9c8368d64d3bb626fc8425bd/src/Index.js#L65-L67

Anyhow, that was more to say that Octicons should be a component with a way of defining which specific Octicon to use. The approach you've followed from Nicolas Gallagher's article is great.

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

Successfully merging a pull request may close this issue.

2 participants