Tooltip

Tooltip component. Part of the Bolt “Components” CSS framework that powers the Bolt Design System.

Install via NPM
npm install @bolt/components-tooltip

Description

The tooltip component provides the user with a onHover Or onClick (button) toggle to display nearly any kind of content or Bolt Component nested within.

Use Cases (not limited to)

  • Help text
  • Navigational assistance (such as language select)
  • Used within other components, such as Share, to enhance functionality and presentation

Best Practices

  • Toggle icons should be tested to ensure smooth transition states
  • The noWrap option should only be used when small snippets of text or content are used
{% include "@bolt-components-tooltip/tooltip.twig" with {
  trigger: {
    type: "text",
    text: "Trigger Text"
  },
  content: "Here is a tooltip! And it even comes with a button toggle!"
} only %}
Name Type Value(s) Description Default
trigger* object
    • type

      What kind of trigger are we using?

      • text OR button
    • text

      The text for our trigger

    • transform

      Trigger text transformation

      • uppercase, lowercase, capitalize
    • icon

      Properties for including an icon with our trigger

        • name

          Name of the icon to be used

        • size

          Size of the icon

          • small, medium, large, xlarge
    • toggle

      If using a button set optional toggle text / icon

        • text

          The text for our toggle

        • name

          The icon for our toggle

Provides the data for our trigger type

N/A
content* any

This can be text OR an included bolt component (like Block List)

N/A
direction string
  • up OR down

Should tooltip push up or down?

up
noWrap boolean
  • TRUE OR FALSE

true for single line content (short snippets)

false
spacing string
  • none, xsmall, small, medium

Spacing within our tooltip content bubble

small