BridgeBeta
  • Brand
  • Digital Assets
    Foundations
    Icons
    Components
    Templates
  • Resources
    Design Tokens
    How-tos
    Best Practices
    Libraries
    Accessibility
    Products List
  • Support
    • Overview
    • Actions
      • Overview
      • Button
      • ContextMenu
      • Link
    • Controls
      • Overview
      • Checkbox
      • Tag
      • Toggle
    • Forms
      • Overview
      • DatePicker
      • FileUploader
      • Input
      • NumberInput
      • RadioButton
      • Search
      • Select
      • Slider
      • TextArea
      • TextInput
    • Hooks
      • useIsomorphicLayoutEffect
      • useMediaQuery
      • useSettings
    • Navigation
      • Overview
      • AnchorNavigation
      • BannerNavigation
      • Breadcrumb
      • Footer
      • InfoBar
      • MainNavigation
      • SecondaryNavigation
      • StepNavigation
      • SubNavigation
    • Overlay
      • Overview
      • Credits
      • Modal
      • ModalWrapper
      • Notification
      • Tooltip
    • Structure
      • Overview
      • Accordion
      • AuthLayout
      • Avatar
      • Callout
      • Card
      • ContentSwitcher
      • Empty
      • Hero
      • InlineLoading
      • Item
      • List
      • Loading
      • mdxComponents
      • Module
      • Pagination
      • ReadMore
      • Story
      • Table
      • Tabs
      • Text
      • Unit
      • User
      • WFPCoreProvider
      • Wrapper
Components
Overlay
Tooltip

Tooltip

  • Design
  • Code
  • Props

Import statement

import { Tooltip } from "@wfp/react"

The Tooltip component is a React component designed to display additional information upon user interaction like click, hover, or focus. The information provided by the tooltip is contextual, useful, and nonessential.

Style Constants

There are two style constants available:

  • tooltipStyle: Default style for the tooltip.
  • tooltipStyleDark: Dark theme style for the tooltip.

Usage

Here’s an example of how to use the Tooltip component:

onHover Trigger

This will create a tooltip with the content "This is a tooltip" that appears at the bottom of the button when hovered over.

Editable Example

<Tooltip
  content="This is a tooltip"
  placement="bottom"
>
  <button>Hover over me!</button>
</Tooltip>;

onClick Trigger

The content appears when the button is clicked on. You cann use the trigger prop to show the content on hover or click.

Editable Example

<Tooltip trigger="click" content="This is a tooltip">
  <button>Click on me</button>
</Tooltip>;

add

Editable Example

<Tooltip
  trigger="click"
  content="This is a tooltip"
  dark
>
  <button>Click on me</button>
</Tooltip>;

Placement

Control the placement of the tooltip by using the placement prop.

'auto' | 'auto-start' | 'auto-end' | 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'right' | 'right-start' | 'right-end' | 'left' | 'left-start' | 'left-end';

Internal Components

TooltipPortal: This internal component is used for rendering the tooltip in a portal if usePortal is true.

Note

The Tooltip component utilizes react-popper-tooltip for positioning and classNames for handling dynamic class names.

On this page

  • Style Constants
  • Usage
  • onHover Trigger
  • onClick Trigger
  • add
  • Placement
  • Internal Components
  • Note

References

  • Storybook
Storybook
Figma library
Contact us
2025 © World Food Programme