-
Notifications
You must be signed in to change notification settings - Fork 133
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
how can i register custom svg images as icons. #93
Comments
+1 - Exactly what I've been looking |
Why not treat it like a vue component instead? |
@toadkicker how would we do that in a way that we can re-use the transformations in this library? e.g. |
Any updates on this? One of the reasons someone might need this if for example I'm building a page with social icons but there's this one network that's not supported by FA. We could always use a custom image/element/component just for that one missing network. But that would break the |
It's the same code you would use in the FontAwesome JavaScript library elsewhere. Define the icon using their format /* icons.js */
export const faMyIcon= { prefix: 'fac', iconName: 'my-icon', icon: [512, 512, [], null, "{your-merged-path-data}"] };
/* app.js */
import { library } from '@fortawesome/fontawesome-svg-core'
import { faMyIcon } from "@app/icons"
library.add(faMyIcon) |
So @joshualyon is exactly right. That's the way you do it. We don't have this officially documented or supported because we need some guard rails up in a lot of places to support it. This is on our todo list though. |
This comment has been minimized.
This comment has been minimized.
@ricardoboss You need to cast it as a import { IconDefinition } from "@fortawesome/fontawesome-common-types";
const faMyIcon: IconDefinition = {...}
library.add(faMyIcon);
// or
const faMyIcon = {...}
library.add(faMyIcon as IconDefinition); |
i want to register custom svg images as icons, how can i do?
like the feature as : Icon.register in https://github.com/Justineo/vue-awesome
here is my custom svg image.
The text was updated successfully, but these errors were encountered: