UNPKG

@payfit/unity-components

Version:

24 lines (23 loc) 1.26 kB
import { ValidTextElements } from '../text/Text.js'; import { TooltipProps } from '../tooltip/Tooltip.js'; export interface DefinitionTooltipProps extends Omit<TooltipProps, 'children'> { /** The HTML element to render the definition tooltip as. Defaults to a `<span>`. */ asElement?: Extract<ValidTextElements, 'abbr' | 'dfn' | 'span'>; /** The text to trigger the tooltip. */ children: string; } /** * Definition tooltips provide brief definitions for words through a tooltip on hover. * They may appear within a sentence or as standalone text, and should be used only to define terms or acronyms. * @param {DefinitionTooltipProps} props - The props for the `DefinitionTooltip` component. * @example * ```tsx * import { DefinitionTooltip } from '@payfit/unity-components' * * <DefinitionTooltip title="I am the description of the definition tooltip">I am an definition tooltip</DefinitionTooltip> * ``` * @see {@link DefinitionTooltipProps} for all available props * @remarks {@link https://www.payfit.design/24f360409/p/05d163-info-link|Design docs} */ declare const DefinitionTooltip: import('react').ForwardRefExoticComponent<DefinitionTooltipProps & import('react').RefAttributes<HTMLDivElement>>; export { DefinitionTooltip };