JSFiddle - React, Tailwind, and code Playground

HTML

<div id=anchor>anchor</div>

<div id=tooltip-cb>
  <div id=tooltip>tooltip</div>
</div>

CSS

body {
  height: 1000px;
}

#anchor {
  anchor-name: --a;
  width: min-content;
  margin-top: 50vh;
}

#tooltip-cb {
  left: anchor(--a right);
  top: calc(anchor(--a top) - 200px);
  height: 400px;
  anchor-scroll: --a;
  width: 100px;
  position: absolute;
  outline: 1px dashed red;
}

#tooltip {
  position: sticky;
  top: 10px;
  height: 200px;
  background: green;
}