Skip to content

Commit 144b2d4

Browse files
feat(sample): add webcomponent tooltip to the sample (#16488)
Co-authored-by: Silvia Ivanova <[email protected]>
1 parent e4794ce commit 144b2d4

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/app/tooltip/tooltip.sample.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,20 @@ <h4 class="sample-title">Simple tooltip settings</h4>
5353
</div>
5454
</article>
5555

56+
<article class="column">
57+
<h4 class="sample-title">WebComponents tooltip</h4>
58+
<div style="margin: 10dvh 5dvw">
59+
<igc-button id="basic-tooltip"> Hover over me </igc-button>
60+
</div>
61+
62+
<igc-tooltip
63+
anchor="basic-tooltip"
64+
>
65+
Hello from the tooltip!
66+
<button class="my-close-btn">Close Me</button>
67+
</igc-tooltip>
68+
</article>
69+
5670
<article class="column">
5771
<h4 class="sample-title">Rich tooltip</h4>
5872
<article class="card-wrapper">

src/app/tooltip/tooltip.sample.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, ViewChild } from '@angular/core';
1+
import { Component, CUSTOM_ELEMENTS_SCHEMA, OnInit, ViewChild } from '@angular/core';
22
import { FormsModule } from '@angular/forms';
33
import {
44
IgxAvatarComponent,
@@ -18,11 +18,18 @@ import {
1818
IgxTooltipTargetDirective,
1919
OverlaySettings,
2020
} from 'igniteui-angular';
21+
import {
22+
defineComponents,
23+
IgcButtonComponent,
24+
IgcTooltipComponent,
25+
} from 'igniteui-webcomponents';
2126

27+
defineComponents(IgcTooltipComponent, IgcButtonComponent);
2228
@Component({
2329
selector: 'app-tooltip-sample',
2430
styleUrls: ['tooltip.sample.css'],
2531
templateUrl: 'tooltip.sample.html',
32+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
2633
imports: [IgxAvatarComponent, IgxTooltipTargetDirective, IgxTooltipDirective, IgxIconComponent, IgxIconButtonDirective, IgxSwitchComponent, FormsModule, IgxSliderComponent, IgxButtonDirective, IgxCardComponent, IgxCardContentDirective, IgxCardActionsComponent, IgxRippleDirective, IgxGridComponent, IgxColumnComponent, IgxCellTemplateDirective]
2734
})
2835
export class TooltipSampleComponent implements OnInit {

0 commit comments

Comments
 (0)