0.0.17 • Published 2 years ago

@illa-design/tooltip v0.0.17

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

Tooltip

A tooltip is a infomative message that appears when a user interacts with an element.

Installation

yarn add @illa-design/tooltip

Import component

import { Tooltip } from "@illa-design/tooltip"

API

Tooltip Basic Properties

PropsDescTypeDefault
colorSchemeSet background color"white" | "blackAlpha" | "gray" | "grayBlue" | "red" | "orange" | "yellow" | "green" | "blue" | "cyan" | "purple" | string"gray"
contentThe content shown in popupstring | ReactNode-
triggerTypes of events that cause the popup to show"hover" | "click" | "focus""hover"
positionThe position of the popup relative to the target."top" | "tl" | "tr" | "bottom" | "bl" | "br" | "left" | "lt" | "lb" | "right" | "rt" | "rb""top"
showArrowWhether to display arrow nodebooleantrue
closeDelayDelay time to closenumber150
openDelayDelay time to shownumber150
autoFitPositionWhether to automatically adjust the position of the popup according to the viewportbooleantrue
closeOnClickWhether to close popup when clicking the child nodebooleantrue
defaultPopupVisibleWhether the popup is visible by defaultboolean-
popupVisibleSet whether the popup is visibleboolean-
disabledWhether to disable the popupboolean-

Trigger Events

PropsDescTypeDefault
onVisibleChangeCallback when the visibility of the popup is changed(visible: boolean) => void-

Example

Basic usage

<Tooltip content="Tooltip">
  <Button>Tooltip</Button>
</Tooltip>

Set popup position

<Tooltip content="Tooltip" position="bottom">
  <Button>Tooltip</Button>
</Tooltip>

Set popup's background color

<Tooltip content="Tooltip" position="top" colorScheme="cyan">
  <Button>Tooltip</Button>
</Tooltip>

Set arrow

<Tooltip content="Tooltip" position="top" colorScheme="cyan" showArrow={false}>
  <Button>Tooltip</Button>
</Tooltip>

Set popup's default visibility status

<Tooltip content="Tooltip" position="top" colorScheme="cyan" defaultPopupVisible>
  <Button>Tooltip</Button>
</Tooltip>

Set popup's delay time to open

<Tooltip content="Tooltip" position="top" colorScheme="cyan" openDelay={1000} closeDelay={1000}>
  <Button>Tooltip</Button>
</Tooltip>
0.0.10

2 years ago

0.0.11

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.15

2 years ago

0.0.9

2 years ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.8

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago