Interface HoverRequest

interface HoverRequest {
    content: string | MarkdownString | HTMLElement;
    cssClasses?: string[];
    position: HoverPosition;
    target: HTMLElement;
    visualPreview?: ((width) => undefined | HTMLElement);
}

Properties

content: string | MarkdownString | HTMLElement
cssClasses?: string[]

Additional css classes that should be added to the hover box. Used to style certain boxes different e.g. for the extended tab preview.

position: HoverPosition

The position where the hover should appear. Note that the hover service will try to invert the position (i.e. right -> left) if the specified content does not fit in the window next to the target element

target: HTMLElement
visualPreview?: ((width) => undefined | HTMLElement)

A function to render a visual preview on the hover. Function that takes the desired width and returns a HTMLElement to be rendered.

Type declaration

    • (width): undefined | HTMLElement
    • Parameters

      • width: number

      Returns undefined | HTMLElement