#Tooltip

A tooltip is a small popover that displays brief information related to an element when the element receives mouse hover or keyboard focus.

#Import

import { Tooltip } from 'bumbag';

#Usage

#Arrow

Add an arrow to a tooltip with the hasArrow prop.

#Placements

You can place the tooltip to a particular side of the target with the placement prop.

#Animation

#Fade

#Slide

#Expand

#Props

#Tooltip Props

content Required

string
  | ReactElement<any, string
  | ((props: any) => ReactElement<any, string
  | ...
  | (new (props: any) => Component<any, any, any>)>)
  | (new (props: any) => Component<any, any, any>)>

placement

"bottom"
  | "left"
  | "right"
  | "top"
  | "center"
  | "top-start"
  | "right-start"
  | "bottom-start"
  | "left-start"
  | "top-end"
  | "right-end"
  | "bottom-end"
  | "left-end"

baseId string

hasArrow boolean

arrowProps

BoxOptions & HTMLAttributes<any> & RefAttributes<any> & { wrapElement?: (element: ReactNode) => ReactNode; } & ... 4 more ... & { ...; }

delay string

Delay of the animation (in s/ms).

duration string

Duration of the animation (in s/ms).

expand

boolean
  | "bottom"
  | "left"
  | "right"
  | "top"
  | "center"

Will the component have an expand animation when it is toggled on/off?

fade boolean

Will the component have a fade animation when it is toggled on/off?

slide boolean | "bottom" | "left" | "right" | "top"

Will the component have a slide animation when it is toggled on/off?

timingFunction string

Timing function of the animation

Inherits Box props

use

string
  | (ComponentClass<any, any> & { useProps: any; })
  | (FunctionComponent<any> & { useProps: any; })

className string

children

string
  | number
  | boolean
  | {}
  | ReactElement<any, string
  | ((props: any) => ReactElement<any, string
  | ...
  | (new (props: any) => Component<any, any, any>)>)
  | (new (props: any) => Component<...>)>
  | ReactNodeArray
  | ReactPortal
  | ((props: BoxProps) => ReactNode)

alignX "left" | "right" | "center"

alignY "bottom" | "top" | "center"

altitude string

variant string

colorMode string

disabled boolean

overrides

{
  useCSSVariables?: boolean;
  altitudes?: AltitudesThemeConfig;
  borders?: BordersThemeConfig;
  borderRadii?: BorderRadiiThemeConfig;
  ... 94 more ...;
  Template?: TemplateThemeConfig;
}

elementRef ((instance: any) => void) | RefObject<any>

themeKey string

#Theming

Tooltip.Reference.styles.base
Hover me
Tooltip.Content.styles.base
Hover me
Tooltip.Arrow.styles.base
Hover me
Copyright © 2020 Jake Moxey