Last active
February 16, 2020 11:59
-
-
Save vanaf1979/010258ae165703d164a5472bed245ddd to your computer and use it in GitHub Desktop.
Gist for my article: WordPress: Adding custom svg icons to your Gutenberg blocks/plugin. https://since1979.dev/wordpress-adding-custom-svg-icons-to-your-gutenberg-blocks-plugin/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import icons from '../icons/icons.js' | |
const { Icon } = wp.components; | |
class ComponentWithIcon extends React.Component { | |
constructor() { | |
super() | |
} | |
render() { | |
return ( | |
<div> | |
<Icon className="icon" icon={icons.github}/> | |
<h4>Component with icon</h4> | |
</div> | |
) | |
} | |
} | |
export default ComponentWithIcon | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment