0.2.0

The tour tooltip displays the step's title and description in a positioned card with an optional arrow pointing at the target. It auto-flips to stay within the viewport and never overlaps the target. Pass false to disable.

Config

PropertyTypeDefaultDescription
sizeComponentSizeMDSize variant scaling padding, gap, min-width and font sizes
placementComponentPlacementTooltip placement relative to the target
autoPlacementBordaTourTooltipAutoPlacement | booleantrueAuto-flip when placement doesn't fit
marginnumber16Minimum gap from viewport edges
offsetnumber8Gap between tooltip and target in pixels
paddingnumber12Inner padding in pixels
arrowBordaTourTooltipArrowProps | falseArrow config. Pass false to hide.
animationBordaTourTooltipAnimation | falseEnter/exit animation settings
hasGlidebooleanfalseWhether the tooltip glides its position between steps
hasSwipeControlbooleantrueEnable swipe-to-navigate on touch devices
isHiddenbooleanfalseWhether the tooltip is currently hidden
ariaPartial<ComponentAriaProps>ARIA attributes
customClassesPartial<BordaTourTooltipComponentClasses>Custom CSS classes
customHtmlPartial<BordaTourTooltipComponentHtml>Custom inner HTML for title/description
customStylesPartial<BordaTourTooltipComponentStyles>Custom inline styles
await borda.mount({
  steps: [
    {
      target: '#element',
      title: 'Title',
      description: 'Description text.',
      placement: 'bottom-center',
    },
  ],
  tourTooltip: {
    offset: 12,
    margin: 20,
    arrow: { placement: 'top-center' },
    autoPlacement: true,
  },
});

Customization

tourTooltip: {
  customClasses: {
    root: 'shadow-xl rounded-2xl',
    title: 'text-lg font-semibold',
    description: 'text-sm text-gray-500',
  },
  customStyles: {
    root: {
      maxWidth: '360px',
    },
  },
}

Replace the tooltip content entirely with customHtml:

tourTooltip: {
  customHtml: {
    title: '<strong>Custom title</strong>',
    description: '<em>Custom description</em>',
  },
}

Swipe navigation (touch)

On touch devices, swiping the tooltip navigates the tour — swipe left for the next step, swipe right for the previous one. A swipe must move at least 50px horizontally and no more than 75px vertically to register, so vertical scrolling near the tooltip doesn't accidentally trigger navigation.

Swiping calls the same next() / prev() handlers as the buttons, so it fires the regular ON_TOUR_NEXT / ON_TOUR_PREV tour events — there's no separate swipe event to subscribe to.

Enabled by default. Disable it globally:

tourTooltip: {
  hasSwipeControl: false,
}

Override it for a single step:

await borda.mount({
  steps: [
    {
      target: '#intro',
      title: 'Welcome',
      description: 'Swipe left or right to navigate.',
      placement: 'bottom-center',
    },
    {
      target: '#chart',
      title: 'Chart',
      description: 'Swipe is off here so it doesn\'t conflict with panning the chart.',
      placement: 'middle-end',
      tourTooltip: { hasSwipeControl: false },
    },
  ],
});

Or scope it to a breakpoint — e.g. only enable swipe below tablet width:

await borda.mount({
  steps: [...],
  tourTooltip: {
    hasSwipeControl: false,
  },
  responsive: {
    768: {
      tourTooltip: { hasSwipeControl: true },
    },
  },
});

Interface

interface BordaTourTooltipProps {
  size: ComponentSize;
  placement: ComponentPlacement;
  offset: number;
  margin: number;
  padding: number;
  arrow: BordaTourTooltipArrowProps | false;
  autoPlacement: BordaTourTooltipAutoPlacement | boolean;
  isHidden: boolean;
  hasGlide: boolean;
  hasSwipeControl: boolean;
  animation: BordaTourTooltipAnimation | false;
  aria: Partial<ComponentAriaProps>;
  customClasses: Partial<BordaTourTooltipComponentClasses>;
  customStyles: Partial<BordaTourTooltipComponentStyles>;
  customHtml: Partial<BordaTourTooltipComponentHtml>;
}