battlecode / galaxy

MIT License
10 stars 3 forks source link

Add tooltip #673

Closed acrantel closed 1 year ago

acrantel commented 1 year ago

image

example usage:

<Tooltip text="this is part of the tooltip.">
  <p className="text-pink-500">the default location for a tooltip is top</p>
</Tooltip>
<Tooltip location="right" text="This is an incredibly long tooltip text that should wrap nicely">
  <Icon name="arrow_up_tray" size="sm" />
</Tooltip>
<Tooltip location="left" text="This is an incredibly long tooltip text that should wrap nicely">
  <Icon name="map" size="sm" />
</Tooltip>
<Tooltip location="bottom" text="short tooltip">
  <Icon name="map" size="sm" />
</Tooltip>
n8kim1 commented 1 year ago

wow fancy demos

wait is this homemade? if so, niceeeee, and might suggest adding the code that generated that screenshot to the repo (is said code also the snippet that you put in PR desc?)

if not homemade would suggest throwing in a link as comment too

acrantel commented 1 year ago

it's custom made - the code that generated the screenshot is in the pr description.

I can put a comment with example usage in the file

acrantel commented 1 year ago

My one thought would be maybe we could rename content to title?

Hmm, I think the text in the tooltip isn't really a title. What if we rename content to text?

lowtorola commented 1 year ago

My one thought would be maybe we could rename content to title?

Hmm, I think the text in the tooltip isn't really a title. What if we rename content to text?

Works for me!