Back to Lit

09

packages/lit-dev-content/site/tutorials/content/tooltip/09.md

latest1.0 KB
Original Source

You just created a nicely polished, easy to use, high performance tooltip element. Great job, you're a tooltip expert!

Extra Credit

  • Add additional ways to specify the tooltip target. Hint: try an id reference.
  • Add options for where to position the tooltip relative to the target. Hint: check out the floating-ui docs.
  • Hide the tooltip when the page scrolls. Hint: add a "leave" event listener for scroll on the document.
  • Remove the tooltip from the DOM completely when it's hidden, and add it again when shown.