Skip to content

Instantly share code, notes, and snippets.

@vanaf1979
Last active February 16, 2020 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanaf1979/010258ae165703d164a5472bed245ddd to your computer and use it in GitHub Desktop.
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/
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