runway

Runway

Tooltip

A simple tooltip component that displays additional information on hover.


Hover me

Hover me

Hover me


The Tooltip component provides a lightweight and customizable tooltip that appears when hovering over an element. It supports various positions and colors.



Usage

javascript

1import Tooltip from "@/components/atoms/Tooltip";
2
3<Tooltip text="This is a tooltip">
4    <div>
5        Hover me
6    </div>
7</Tooltip>



Props

PropTypeDefaultDescription
childrenReactNode-The element that triggers the tooltip on hover.
textstring""The text to display inside the tooltip.
position"top" | "bottom" | "left" | "right""top"The position of the tooltip relative to the target element.
colorstring"primary"Tailwind color key used for the toggle switch.
variant"solid" | "soft""solid"The variant of the tooltip.
borderRadiusstring"lg"The border radius of the tooltip.
borderbooleanfalseWhether to add a border to the tooltip.
classNamestring""Additional Tailwind classes for the tooltip.
...propsobject-Any other valid HTML <div> attributes (e.g. role, aria-*, etc.).



Examples

Basic Tooltip


Tooltip with Custom Position

Hover here

Tooltips with Different Colors

Hover me for soft red
Hover me for green