import {MatTooltipModule} from '@angular/material/tooltip';
MatTooltip
Directive that attaches a material design tooltip to the host element. Animates the showing and hiding of a tooltip provided position (defaults to below the element).
https://material.io/design/components/tooltips.html
Selector: [matTooltip]
Exported as: matTooltipName | Description |
---|---|
@Input('matTooltipDisabled')
|
Disables the display of the tooltip. |
@Input('matTooltipHideDelay')
|
The default delay in ms before hiding the tooltip after hide is called |
@Input('matTooltip')
|
The message to be displayed in the tooltip |
@Input('matTooltipPosition')
|
Allows the user to define the position of the tooltip relative to the parent element |
@Input('matTooltipShowDelay')
|
The default delay in ms before showing the tooltip after show is called |
@Input('matTooltipClass')
|
Classes to be passed to the tooltip. Supports the same syntax as |
hide | |
---|---|
Hides the tooltip after the delay in ms, defaults to tooltip-delay-hide or 0ms if no input |
|
Parameters | |
delay number = this.hideDelay
|
|
show | |
---|---|
Shows the tooltip after the delay in ms, defaults to tooltip-delay-show or 0ms if no input |
|
Parameters | |
delay number = this.showDelay
|
|
toggle | |
---|---|
Shows/hides the tooltip |
MatTooltipDefaultOptions
Default matTooltip
options that can be overridden.
Name | Description |
---|---|
|
|
|
|
|
|
|
TooltipPosition
type TooltipPosition = 'left' | 'right' | 'above' | 'below' | 'before' | 'after';
TooltipVisibility
type TooltipVisibility = 'initial' | 'visible' | 'hidden';
SCROLL_THROTTLE_MS
Time in ms to throttle repositioning after scroll events.
const SCROLL_THROTTLE_MS: 20;
TOOLTIP_PANEL_CLASS
CSS class that will be attached to the overlay panel.
const TOOLTIP_PANEL_CLASS: "mat-tooltip-panel";
MAT_TOOLTIP_SCROLL_STRATEGY
Injection token that determines the scroll handling while a tooltip is visible.
const MAT_TOOLTIP_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>;
MAT_TOOLTIP_DEFAULT_OPTIONS
Injection token to be used to override the default options for matTooltip
.
const MAT_TOOLTIP_DEFAULT_OPTIONS: InjectionToken<MatTooltipDefaultOptions>;