UNPKG

@primer/react

Version:

An implementation of GitHub's Primer Design System using React

32 lines 1.38 kB
import React, { type ForwardRefExoticComponent } from 'react'; import { type KeybindingHintProps } from '../KeybindingHint'; import type { SlotMarker } from '../utils/types'; export type TooltipDirection = 'nw' | 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w'; export type TooltipProps = React.PropsWithChildren<{ direction?: TooltipDirection; text: string; type?: 'label' | 'description'; keybindingHint?: KeybindingHintProps['keys']; /** * Delay in milliseconds before showing the tooltip * @default short (50ms) * medium (400ms) * long (1200ms) */ delay?: 'short' | 'medium' | 'long'; /** * Private API for use internally only. Prevents the tooltip from opening if `true`. * * Accessibility note: This prop should be used with caution. Only use when needing to * programmatically close the tooltip in response to a specific user action, such as * opening a menu, or content where the tooltip could overlap with interactive content. * * @default false */ _privateDisableTooltip?: boolean; }> & React.HTMLAttributes<HTMLElement>; export declare const TooltipContext: React.Context<{ tooltipId?: string; }>; export declare const Tooltip: ForwardRefExoticComponent<React.PropsWithoutRef<TooltipProps> & React.RefAttributes<HTMLElement>> & SlotMarker; //# sourceMappingURL=Tooltip.d.ts.map