UNPKG

@stihl-design-system/components

Version:

Welcome to the STIHL Design System react component library.

41 lines (40 loc) 1.84 kB
import { HTMLProps, JSX } from 'react'; import { OpenChangeReason, Placement } from '@floating-ui/react'; export interface TooltipProps { /** Content within the Tooltip. */ children?: React.ReactNode; /** Opens the Tooltip on initial render. * @default false */ initialOpen?: boolean; /** The placement of the Tooltip relative to the anchor element. * @default 'top' */ placement?: Placement; /** The offset distance in "px" between the Tooltip and its anchor element. * @default 6 */ tooltipOffset?: number; /** Controls the open state of the Tooltip. If provided, it will be a controlled component. * @default false */ isOpen?: boolean; /** A function that is called when the open state should change. */ onOpenChange?: (isOpen: boolean, event?: Event, reason?: OpenChangeReason) => void; } /** * The Tooltip component is used to display additional information or actions related to an anchor element. It is opened on hover or focus. It can be positioned relative to the anchor and supports various placements and offsets. * * Design in Figma: [Tooltip](https://www.figma.com/design/qXldpLO6gxHJNLdcXIPxYt/branch/HovZmjHiwxguawTWTO6ibS/Core-Components-%F0%9F%92%A0?node-id=26075-11658&p=f&t=TYKSgw0ZlRDBBUfn-11) * */ export declare const Tooltip: { ({ children, ...rest }: TooltipProps): JSX.Element; /** attach static members */ Anchor: import('react').ForwardRefExoticComponent<Omit<HTMLProps<HTMLElement> & TooltipAnchorProps, "ref"> & import('react').RefAttributes<HTMLElement>>; Content: import('react').ForwardRefExoticComponent<Omit<HTMLProps<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>; displayName: string; }; interface TooltipAnchorProps { children: React.ReactNode; } export {};