@pikas-ui/tooltip

This package contains a tooltip component that can be used to display a tooltip on hover or focus.

This library is based on Radix Ui.

Change Log

Requirements

To use this package, you must install the @pikas-ui/styles package.

Installation

You can install this package using npm, yarn, or pnpm.

npm install @pikas-ui/tooltip
yarn add @pikas-ui/tooltip
pnpm add @pikas-ui/tooltip

Usage

Tooltip

The tooltip component is used to display a tooltip on hover or focus.

import { Tooltip } from '@pikas-ui/tooltip';
import { IconByName } from '@pikas-ui/icons';

const Example: React.FC = () => {
  return (
    <Tooltip content="Hello world">
      <IconByName size={40} name="bx:baguette" />
    </Tooltip>
  );
};

Props

PropDescriptionTypeDefault
contentTooltip contentstring or ReactNode-
childrenTrigger elementReactNode-
backgroundColorNameBackground colorPikasColors"white"
openOpen stateboolean-
defaultOpenDefault openboolean-
onOpenChangeEvent handler(open: boolean) => void-
delayDurationDelay durationnumber-
skipDelayDurationSkip delay durationnumber-
hasArrowHas arrow indicatorbooleantrue
arrowSizeArrow sizenumber10
arrowOffsetArrow offsetnumber8
sideSide of the tooltipTooltipSide-
sideOffsetSide offset of the tooltipnumber-
alignAlign of contentTooltipAlign-
alignOffsetAlign offsetnumber-
avoidCollisionsAvoid collisionsbooleantrue
collisionPaddingCollision tolerance of the tooltipnumber-
borderRadiusBorder radius of the tooltipPikasRadius"md"
fontSizeFont size of contentPikasFontSize"em-small"
fontWeightFont weight of contentPikasFontWeight-
boxShadowBox shadow of the tooltipPikasShadow"bottom-md"
paddingPadding of the tooltipTooltipPadding"md"
cssCustom cssTooltipCSS-

Contributing

This documentation can be edited on GitHub here