Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IOptions

Options for setting the geometry of a hovering node and its anchor node.

Hierarchy

  • IOptions

Index

Properties

anchor

anchor: ClientRect

The referent anchor rectangle to which the hover box is bound.

Notes

In an editor context, this value will typically be the cursor's coordinate position, which can be retrieved via calling the getCoordinateForPosition method.

host

host: HTMLElement

The node that hosts the anchor.

Notes

The visibility of the anchor rectangle within this host node is the heuristic that determines whether the hover box ought to be visible.

maxHeight

maxHeight: number

The maximum height of a hover box.

Notes

This value is only used if a CSS max-height attribute is not set for the hover box. It is a fallback value.

minHeight

minHeight: number

The minimum height of a hover box.

node

node: HTMLElement

The hover box node.

Optional offset

offset: { horizontal?: number; vertical?: { above?: number; below?: number } }

Optional pixel offset values added to where the hover box should render.

Notes

This option is useful for passing in values that may pertain to CSS borders or padding in cases where the text inside the hover box may need to align with the text of the referent editor.

Because the hover box calculation may render a box either above or below the cursor, the vertical offset accepts above and below values for the different render modes.

Type declaration

  • Optional horizontal?: number
  • Optional vertical?: { above?: number; below?: number }
    • Optional above?: number
    • Optional below?: number

Optional privilege

privilege: "above" | "below" | "forceAbove" | "forceBelow"

If space is available both above and below the anchor, denote which location is privileged. Use forceBelow and forceAbove to mandate where hover box should render relative to anchor.

Notes

The default value is 'below'.

Optional style

style: CSSStyleDeclaration

If the style of the node has already been computed, it can be passed into the hover box for geometry calculation.

Generated using TypeDoc