@primer/react
Version:
An implementation of GitHub's Primer Design System using React
32 lines (31 loc) • 1.34 kB
TypeScript
import { SlotMarker } from "../utils/types/Slots.js";
import { KeybindingHintProps } from "../KeybindingHint/props.js";
import React, { ForwardRefExoticComponent } from "react";
//#region src/TooltipV2/Tooltip.d.ts
type TooltipDirection = 'nw' | 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w';
type TooltipProps = React.PropsWithChildren<{
direction?: TooltipDirection;
text: string;
type?: 'label' | 'description';
keybindingHint?: KeybindingHintProps['keys'] | Array<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>;
declare const Tooltip: ForwardRefExoticComponent<React.PropsWithoutRef<TooltipProps> & React.RefAttributes<HTMLElement>> & SlotMarker;
//#endregion
export { Tooltip, TooltipDirection, TooltipProps };