Tooltip

Tooltips provide additional information upon hover or click. They often include contextual helper text to guide the user through the experience or provide more detail. Tooltips in Base have no arrow indicator and can be placed around any point of an object. Motion helps to reinforce its origin position.

Tooltip stateful example

You can use tooltips in many places, including inline text such as this. Tooltips are essentially just a Popover with a few style tweaks, so you can use all the features that Popover supports.

Tooltip stateful example with complex content

You can use tooltips in many places, including inline text such as this. Tooltips are essentially just a Popover with a few style tweaks, so you can use all the features that Popover supports.

Overrides

Additionally, you can fully customize any part of the Tooltip through the overrides prop. The Tooltip consists of multiple subcomponents that are listed bellow and you can override each one of them. To help you identify the names of these subcomponents, you can highlight them through this selector:

hover over me

Note: You should always use longhand CSS properties. Mixing shorthands and longhands will lead into strange behaviors!

Stateful Tooltip API

Warning any = "Prop types are not shown in dev mode"

extract-react-types is not being run in dev mode for speed reasons. If you need to see prop types add the environment variable FORCE_EXTRACT_REACT_TYPES eg:

  • FORCE_EXTRACT_REACT_TYPES=true yarn start <packageName>
  • FORCE_EXTRACT_REACT_TYPES=true yarn start:<team>