To customize the appearance of the tour tooltips, provide a component to the tooltipComponent prop in Joyride or the useJoyride hook. The component receives TooltipRenderProps which includes access to the current step, navigation props (backProps, closeProps, primaryProps, skipProps), and metadata (index, isLastStep, size).
import type { TooltipRenderProps } from 'react-joyride';
function CustomTooltip({
backProps,
closeProps,
index,
isLastStep,
primaryProps,
size,
skipProps,
step,
tooltipProps,
}: TooltipRenderProps) {
return (
<div
{...tooltipProps}
style={{
background: '#fff',
borderRadius: 8,
maxWidth: 400,
padding: 20,
width: step.width,
}}
>
{step.title && <h3 style={{ margin: '0 0 8px' }}>{step.title}</h3>}
<div>{step.content}</div>
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: 16 }}>
{step.buttons.includes('skip') && !isLastStep && (
<button {...skipProps} type="button">Skip</button>
)}
<div style={{ display: 'flex', gap: 8, marginLeft: 'auto' }}>
{index > 0 && (
<button {...backProps} type="button">Back</button>
)}
<button {...primaryProps} type="button">
{isLastStep ? 'Done' : `Next (${index + 1}/${size})`}
</button>
</div>
</div>
</div>
);
}
// Usage:
// <Joyride tooltipComponent={CustomTooltip} ... />
// or in useJoyride: useJoyride({ tooltipComponent: CustomTooltip, ... })