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

Export alias/tags for each icons similarly to how the search work in the documentation #31

Closed
Simon-Renault opened this issue Oct 31, 2022 · 5 comments

Comments

@Simon-Renault
Copy link

Simon-Renault commented Oct 31, 2022

I assume that since the search in the Phosphor icon documentation match or more than the name of the icon itself, the information to buidd those tags should already exist somewhere.

Screenshot 2022-10-31 at 11 42 59

Similarly to how we do :

Airplane.displayName = "Airplane";

we could do :

Airplane.tags = ["Airplane","Plane","Fight", ... ];


Use case :

Allowing users in an app to pick an icon for a given primitive. Enabling a search by tag in the front end would be great.
Same in the Figma library, adding those tags to the icon description would make it so much easier to search

@rektdeckard
Copy link
Member

rektdeckard commented Jan 7, 2023

This is an interesting idea, I haven't seen static component fields used for other metadata before... These tags are really more of an implementation detail of our website and plugin search, and are handwritten and not a true substitute for something like ElasticSearch or some other intelligent search mechanism, but the cost seems pretty low to add a few extra bytes to each component.

An alternative approach could be to publish a separate, framework-agnostic package with the tag and category data for every icon. This might be a bit more scalable. I'll look into it.

@Simon-Renault
Copy link
Author

It would also be great to have those tags as a description for each icon in Figma, makes the search much better.

As right now to get the "fine" icon I often end up searching "document" ...

@rektdeckard
Copy link
Member

@Simon-Renault we have opted to expose a separate package, @phosphor-icons/core which will include both catalog data (tags, category, name, version released, etc.) and the raw SVG files, to be both framework/platform agnostic, and to keep bundle sizes down for the vast majority of users who do not need this. You can use it now via NPM, though it is lacking some documentation at the moment. The catalog is pegged to 1.4 release (current version).

As for adding tags to documentation description in Figma library, that's definitely something we can do!

@Simon-Renault
Copy link
Author

@rektdeckard Amazing thank you so much for this! Can't wait for the Figma lib to use those as well :)

@rektdeckard
Copy link
Member

BTW, tags are now part of component descriptions in the Figma library.

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

No branches or pull requests

2 participants