Last active
October 12, 2018 10:57
-
-
Save zgordon/6be6e59767254687811d4deda57dec22 to your computer and use it in GitHub Desktop.
An example of how to use the Tooltip component in Gutenberg. Place the code inside of your block edit setting.
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
const { | |
Button, | |
Dashicon, | |
Tooltip, | |
} = wp.components; | |
// Wrap the Tooltip component around whatever you want to activate the tooltip on hover | |
<Tooltip | |
text={ __( 'Add Tooltip Text Here' ) } | |
> | |
<Button> | |
// Change icon to desired dashicon icon or replace component with SVG | |
<Dashicon icon="edit" /> | |
</Button> | |
</Tooltip> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment