Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
Created October 17, 2020 21:30
Show Gist options
  • Save nolanlawson/781e7084e4c17acb921357489d51a5b0 to your computer and use it in GitHub Desktop.
Save nolanlawson/781e7084e4c17acb921357489d51a5b0 to your computer and use it in GitHub Desktop.
emoji-picker tooltip example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>emoji-picker tooltip demo</title>
<style>
.tooltip:not(.shown) {
display: none;
}
</style>
</head>
<body>
<button onclick="toggle()">Click me</button>
<div class="tooltip" role="tooltip">
<emoji-picker></emoji-picker>
</div>
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script type="module" src="https://unpkg.com/emoji-picker-element@1"></script>
<script>
const button = document.querySelector('button')
const tooltip = document.querySelector('.tooltip')
Popper.createPopper(button, tooltip)
function toggle() {
tooltip.classList.toggle('shown')
}
</script>
</body>
</html>
@ChathuraGH
Copy link

I gave a star to you to inspire you .Thanks for code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment