0.2.0

Borda supports configurable animations for tooltip enter/exit and overlay spotlight transitions. All animation settings are grouped under the animation config key.

Config

PropertyTypeDefaultDescription
isEnabledbooleantrueMaster switch for all animations
tooltip.enterAnimationEffectFADETooltip enter effect
tooltip.exitAnimationEffectFADETooltip exit effect
tooltip.enterDurationnumber200Enter animation duration in ms
tooltip.exitDurationnumber150Exit animation duration in ms
tooltip.easingstringease-outCSS easing function
tooltip.appearanceBordaScrollAppearanceAFTER_SCROLLWhen to reveal the tooltip relative to scroll animation
tooltip.transitionBordaTooltipTransitionFADEHow the tooltip moves between steps
overlay.transitionDurationnumber350Spotlight transition duration between steps
overlay.easingstringease-in-outCSS easing for spotlight movement

Tooltip transition

Controls how the tooltip moves between steps:

TransitionDescription
FADEHide the tooltip while transitioning, then fade it in at the new step
GLIDEKeep the tooltip visible and glide its position to the new step
import { BordaTooltipTransition } from '@retoo/borda';

await borda.mount({
  steps: [...],
  animation: {
    tooltip: {
      transition: BordaTooltipTransition.GLIDE,
    },
  },
});

Animation effects

EffectDescription
NONENo animation
FADEOpacity transition
SCALEScale from center
SLIDESlide from edge
import { AnimationEffect } from '@retoo/borda';

await borda.mount({
  steps: [
    {
      target: '#element',
      title: 'Title',
      description: 'Description',
      placement: 'bottom-center',
    },
  ],
  animation: {
    isEnabled: true,
    tooltip: {
      enter: AnimationEffect.FADE,
      exit: AnimationEffect.FADE,
      enterDuration: 300,
      exitDuration: 200,
    },
    overlay: {
      transitionDuration: 400,
    },
  },
});

Disabling animation

Pass false to disable all animations globally:

await borda.mount({
  steps: [
    {
      target: '#element',
      title: 'Title',
      description: 'Description',
      placement: 'bottom-center',
    },
  ],
  animation: false,
});

Runtime API

Read the resolved animation settings at runtime:

instance.animation.isEnabled;
instance.animation.tooltip;
instance.animation.overlay;