@financial-times/o3-tooltip
Version:
Provides a viewport-aware tooltip for annotating or or highlighting other aspects of a product's UI
26 lines (24 loc) • 773 B
TypeScript
type TooltipProps = {
id?: string;
content: string;
title?: string;
placement: 'top' | 'right' | 'bottom' | 'left';
onClose?: () => void;
};
interface OnboardingToolTipProps extends Omit<TooltipProps, 'placement'> {
contentId: string;
targetId: string;
placement: 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-start' | 'bottom' | 'bottom-end' | 'left-start' | 'left' | 'left-end';
}
interface ToggleToolTipProps extends TooltipProps {
infoLabel?: string;
}
declare global {
namespace JSX {
interface IntrinsicElements {
'o3-tooltip-onboarding': any;
'o3-tooltip-toggle': any;
}
}
}
export type { OnboardingToolTipProps as O, ToggleToolTipProps as T };