Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Properties

Optional aria-describedby

aria-describedby?: string

An optional additional aria-describedby id or ids to merge with the tooltip id. This is really used for things like notifications or when multiple elements describe your tooltipped element.

children

children: ChildrenRenderer | ChildElement

The children for this component should either be a function or a single element. When the children is a single React element, this component will clone in an id, aria-describedby, and all the event handlers required to show and hide a tooltip relative to that element. This means that you will need to ensure that the child component accepts and passes down the on* event handlers to a DOM node as well as the id and aria-describedby for accessibility. Every component within react-md should do this by default.

If the children is a function, the id, aria-describedby, and event handlers will be provided as well as a new tooltip prop so that you have more control over rendering the tooltip.

If the tooltip prop was not provided to this component, the aria-describedby and the event handlers will be omitted.

Optional className

className?: string

An optional className for the tooltip

Optional defaultPosition

defaultPosition?: SimplePosition

An optional position to use before the positioning calculation has occurred. This is also used to determine if the position should be horizontal vs vertical.

Vertical - "below" or "above" Horizontal - "left" or "right"

defaultvalue

"below"

Optional dense

dense?: boolean

Boolean if the tooltip is using the dense spec. This will reduce the padding, margin and font size for the tooltip and is usually used for desktop displays.

Optional denseSpacing

denseSpacing?: string | number

The amount of spacing to use for a dense tooltip. This is the distance between the container element and the tooltip.

Optional disableAutoSpacing

disableAutoSpacing?: boolean

Since react-md provides mixins to automatically apply a dense spec through mixins via media queries, the dense spec might be applied in css instead of in JS. This component will actually check the current spacing amount that has been applied when the tooltip becomes visible.

If this behavior is not desired, you can enable this prop and it will only use the provided spacing or denseSpacing props based on the dense prop.

Note: This will be defaulted to true when the process.env.NODE_ENV === 'test' since test environments normally don't have a default window.getComgetComputedStyle value that is not NaN which will display errors in your tests.

Optional disableHoverMode

disableHoverMode?: boolean

Boolean if the hover mode functionality should be disabled for this instance instead of inheriting the value from the HoverModeProvider.

Optional disableSwapping

disableSwapping?: boolean

Boolean if the auto-swapping behavior should be disabled. When this value is undefined, it'll be treated as true when the position prop is defined, otherwise false.

Optional focusTime

focusTime?: number

The amount of time to wait (in ms) before showing the tooltip after a keyboard user has triggered a focus event. You probably won't ever need to change this value.

id

id: string

The id for the element that has a tooltip. This is always required since it will be passed down to the containerProps in the children renderer function. It is also used to generate a tooltipId when there is a tooltip.

Optional lineWrap

lineWrap?: boolean

Boolean if the tooltip should allow line wrapping. This is disabled by default since the tooltip will display weirdly when its container element is small in size. It is advised to only enable line wrapping when there are long tooltips or the tooltips are bigger than the container element.

Once line wrapping is enabled, you will most likely need to set some additional padding and widths.

Optional onBlur

onBlur?: FocusEventHandler<HTMLElement>

Optional onClick

onClick?: MouseEventHandler<HTMLElement>

An optional event handler to merge with the hover mode visibility hander. If this function calls event.stopPropagation(), the hover mode behavior will be disabled.

Optional onContextMenu

onContextMenu?: MouseEventHandler<HTMLElement>

Optional onEnter

onEnter?: TransitionEnterHandler

This function will be called once the TransitionStage has been set to "enter".

see

TransitionEnterHandler

Optional onEntered

onEntered?: TransitionEnterHandler

This function will be called once the TransitionStage has been set to "entering".

see

TransitionEnterHandler

Optional onEntering

onEntering?: TransitionEnterHandler

This function will be called once the TransitionStage has been set to "enter".

see

TransitionEnterHandler

Optional onExit

onExit?: TransitionExitHandler

This function will be called once the TransitionStage has been set to "entered".

see

TransitionEnterHandler

Optional onExited

onExited?: TransitionExitHandler

This function will be called once the TransitionStage has been set to "exited".

see

TransitionExitHandler

Optional onExiting

onExiting?: TransitionExitHandler

This function will be called once the TransitionStage has been set to "exiting".

see

TransitionExitHandler

Optional onFocus

onFocus?: FocusEventHandler<HTMLElement>

Optional onKeyDown

onKeyDown?: KeyboardEventHandler<HTMLElement>

Optional onMouseEnter

onMouseEnter?: MouseEventHandler<HTMLElement>

An optional event handler to merge with the hover mode visibility hander. If this function calls event.stopPropagation(), the hover mode behavior will be disabled.

Optional onMouseLeave

onMouseLeave?: MouseEventHandler<HTMLElement>

An optional event handler to merge with the hover mode visibility hander. If this function calls event.stopPropagation(), the hover mode behavior will be disabled.

Optional onTouchStart

onTouchStart?: TouchEventHandler<HTMLElement>

Optional portal

portal?: boolean

Boolean if the portal should be used.

Optional portalInto

portalInto?: PortalInto

Optional portalIntoId

portalIntoId?: string

Optional position

position?: SimplePosition

An optional controlled position to use that will disable the functionality to determine the "best" position to render the tooltip within the viewport.

Optional spacing

spacing?: string | number

The amount of spacing to use for a non-dense tooltip. This is the distance between the container element and the tooltip.

Optional style

style?: CSSProperties

An optional style for the tooltip.

Optional temporary

temporary?: boolean

{@inheritDoc CSSTransitionHookOptions.temporary}

Optional threshold

threshold?: number

This value should be between 0 and 1 and will be multiplied by either the viewport height or viewport width to determine the best position to render the tooltip based on available space within the viewport.

You probably won't ever really need to update this value.

Optional tooltip

tooltip?: ReactNode

The tooltip to display. When this is false-ish, the children renderer will always return null for the tooltip prop.

Optional touchTime

touchTime?: number

The amount of time to wait (in ms) before showing the tooltip after triggering a touchstart event. You probably won't ever need to change this value.

The default time is about the same it takes to display the context menu with a "long touch" and cancel displaying the context menu.

Optional vhMargin

vhMargin?: number

This is the viewport height margin to use in the positioning calculation. This is just used so that the tooltip can be placed with some spacing between the top and bottom edges of the viewport if desired.

Optional vwMargin

vwMargin?: number

This is the viewport width margin to use in the positioning calculation. This is just used so that the tooltip can be placed with some spacing between the left and right edges of the viewport if desired.

Generated using TypeDoc