|
| 1 | +<div class="triggers-container"> |
| 2 | + <igx-card> |
| 3 | + <igx-card-header> |
| 4 | + <h4 igxCardHeaderTitle>Default triggers</h4> |
| 5 | + </igx-card-header> |
| 6 | + <igx-card-content> |
| 7 | + <p> |
| 8 | + Hovering over the button below will display the tooltip using its default configuration: it appears on <strong>pointer enter</strong> and hides on <strong>pointer leave</strong> or <strong>click</strong>. |
| 9 | + </p> |
| 10 | + <button igxButton="outlined" [igxTooltipTarget]="triggersDefault">Hover over me</button> |
| 11 | + </igx-card-content> |
| 12 | + </igx-card> |
| 13 | + <div #triggersDefault="tooltip" igxTooltip> |
| 14 | + I am shown on pointer enter and hidden on pointer leave and/or click. |
| 15 | + </div> |
| 16 | + |
| 17 | + <igx-card> |
| 18 | + <igx-card-header> |
| 19 | + <h4 igxCardHeaderTitle>Focus based</h4> |
| 20 | + </igx-card-header> |
| 21 | + <igx-card-content> |
| 22 | + <p> |
| 23 | + In this instance, the tooltip is bound to show on its anchor |
| 24 | + <strong>focus</strong> and will hide when its anchor is |
| 25 | + <strong>blurred</strong>. |
| 26 | + </p> |
| 27 | + <p>Try to navigate with a Tab key to the anchor to see the effect.</p> |
| 28 | + <button igxButton="outlined" [igxTooltipTarget]="triggersFocusBlur" [showDelay]="0" [hideDelay]="0" [showTriggers]="'focus'" [hideTriggers]="'blur'">Focus me</button> |
| 29 | + </igx-card-content> |
| 30 | + </igx-card> |
| 31 | + <div #triggersFocusBlur="tooltip" igxTooltip> |
| 32 | + I am shown on focus and hidden on blur. |
| 33 | + </div> |
| 34 | + |
| 35 | + <igx-card> |
| 36 | + <igx-card-header> |
| 37 | + <h4 igxCardHeaderTitle>Same trigger(s) for showing and hiding</h4> |
| 38 | + </igx-card-header> |
| 39 | + <igx-card-content> |
| 40 | + <p> |
| 41 | + The same trigger can be bound to both show and hide the tooltip. The |
| 42 | + button below has its tooltip bound to show/hide on |
| 43 | + <strong>click</strong>. |
| 44 | + </p> |
| 45 | + <button igxButton="outlined" [igxTooltipTarget]="triggersClick" [showDelay]="0" [hideDelay]="0" [showTriggers]="'click'" [hideTriggers]="'click'">Click</button> |
| 46 | + </igx-card-content> |
| 47 | + </igx-card> |
| 48 | + <div #triggersClick="tooltip" igxTooltip> |
| 49 | + I am shown on click and will hide on anchor click. |
| 50 | + </div> |
| 51 | + |
| 52 | + <igx-card> |
| 53 | + <igx-card-header> |
| 54 | + <h4 igxCardHeaderTitle>Keyboard interactions</h4> |
| 55 | + </igx-card-header> |
| 56 | + <igx-card-content> |
| 57 | + <p> |
| 58 | + Keyboard interactions are also supported. The button below has its |
| 59 | + tooltip bound to show on a <strong>keypress</strong> and hide on a |
| 60 | + <strong>keypress</strong> or <strong>blur</strong>. |
| 61 | + </p> |
| 62 | + <p>Try it out by focusing the button and pressing a key.</p> |
| 63 | + <button igxButton="outlined" [igxTooltipTarget]="triggersKeypress" [showTriggers]="'keypress'" [hideTriggers]="'keypress,blur'">Press a key</button> |
| 64 | + </igx-card-content> |
| 65 | + </igx-card> |
| 66 | + <div #triggersKeypress="tooltip" igxTooltip> |
| 67 | + I am shown on a keypress and will hide on a keypress or blur. |
| 68 | + </div> |
| 69 | + |
| 70 | + <igx-card> |
| 71 | + <igx-card-header> |
| 72 | + <h4 igxCardHeaderTitle>Custom events</h4> |
| 73 | + </igx-card-header> |
| 74 | + <igx-card-content> |
| 75 | + <p> |
| 76 | + The tooltip supports any DOM event, including custom events. Try entering a value in the input below, then "commit" it by either <strong>blurring</strong> the input or pressing <strong>Enter</strong>. |
| 77 | + </p> |
| 78 | + <igc-input outlined label="Username" [igxTooltipTarget]="triggersCustom" [showTriggers]="'igcChange'"></igc-input> |
| 79 | + </igx-card-content> |
| 80 | + </igx-card> |
| 81 | + <div #triggersCustom="tooltip" igxTooltip> |
| 82 | + Value changed! |
| 83 | + </div> |
| 84 | +</div> |
0 commit comments