Created
May 3, 2019 10:09
-
-
Save werenall/59f20217071c1f3050c045e4805feafb to your computer and use it in GitHub Desktop.
Atom-based tooltip
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
(let [display-tooltip? (r/atom false)] | |
(fn [] | |
[:div.tooltip-controller | |
[:button | |
{:on-click #(swap! display-tooltip? not)} | |
"spawn tooltip"] | |
(when @display-tooltip? | |
[:div.tooltip.tooltip--bottom | |
[:button {:on-click #(reset! display-tooltip? false)} "x"] | |
[:p "Hello there!"]])])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment