Ignite UI for Web Components Tooltip 구성 요소는 특정 요소에 대한 도구 설명을 표시하는 방법을 제공합니다. 툴팁은 요소와 관련된 정보를 표시하는 팝업으로, 일반적으로 요소가 키보드 포커스를 받거나 마우스가 그 위로 마우스를 가져갈 때 표시됩니다.
<!DOCTYPE html><html><head><title>Tooltip Overview</title><metacharset="UTF-8" /><linkrel="shortcut icon"href="https://static.infragistics.com/xplatform/images/browsers/wc.png"><linkrel="stylesheet"href="https://fonts.googleapis.com/icon?family=Material+Icons" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Kanit&display=swap" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Titillium Web" /><linkrel="stylesheet"href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css"type="text/css" /></head><body><divid="root"><divclass="container sample center"><igc-avatarid="avatar"src="https://www.infragistics.com/angular-demos-lob/assets/images/avatar/10.jpg"shape="circle"></igc-avatar><igc-tooltipanchor="avatar">Her name is Madelyn James</igc-tooltip></div></div><!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %>
<scriptsrc="src/index.ts"></script>
<% } %>
</body></html>html
<!DOCTYPE html><html><head><title>Rich Tooltip</title><metacharset="UTF-8" /><linkrel="shortcut icon"href="https://static.infragistics.com/xplatform/images/browsers/wc.png"><linkrel="stylesheet"href="https://fonts.googleapis.com/icon?family=Material+Icons" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Kanit&display=swap" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Titillium Web" /><linkrel="stylesheet"href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css"type="text/css" /></head><body><divid="root"><divclass="container sample center"><divclass="map"><igc-iconid="location_icon"slot="actions"variant="flat"collection="material"exportparts="icon"name="location_on"></igc-icon><igc-tooltipanchor="location_icon"class="locationTooltip"><divclass="locationTooltipContent"><igc-avatarclass="logo"src="https://www.infragistics.com/angular-demos-lob/assets/images/card/avatars/igLogo.png"size="medium"shape="square"></igc-avatar><div><div>Infragistics Inc. HQ</div><div>2 Commerce Dr, Cranbury, NJ 08512, USA</div></div></div></igc-tooltip></div></div></div><!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %>
<scriptsrc="src/index.ts"></script>
<% } %>
</body></html>html
<igc-tooltipshow-delay="600"hide-delay="800">
Her name is Madelyn James.
</igc-tooltip>html
Tooltip API 메서드(show, hide 및 toggle)는 showDelay 및 hideDelay 속성을 고려하지 않는다는 점에 유의해야 합니다. 호출되면 즉시 행동합니다.
배치
또한 IgcTooltipComponent 대상 요소를 기준으로 쉽게 배치할 수 있습니다. 다음 위치 옵션 중 하나와 함께 속성을 사용 placement 하기만 하면 됩니다. top top-start top-end bottom bottom-start bottom-end right right-start right-end left left-start left-end
<!DOCTYPE html><html><head><title>Tooltip Placement</title><metacharset="UTF-8" /><linkrel="shortcut icon"href="https://static.infragistics.com/xplatform/images/browsers/wc.png"><linkrel="stylesheet"href="https://fonts.googleapis.com/icon?family=Material+Icons" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Kanit&display=swap" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Titillium Web" /><linkrel="stylesheet"href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css"type="text/css" /></head><body><divid="root"><divclass="container sample center"><divid="btnWrapper"></div></div></div><!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %>
<scriptsrc="src/index.ts"></script>
<% } %>
</body></html>html
<!DOCTYPE html><html><head><title>Tooltip Triggers</title><metacharset="UTF-8" /><linkrel="shortcut icon"href="https://static.infragistics.com/xplatform/images/browsers/wc.png"><linkrel="stylesheet"href="https://fonts.googleapis.com/icon?family=Material+Icons" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Kanit&display=swap" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Titillium Web" /><linkrel="stylesheet"href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css"type="text/css" /></head><body><divid="root"><divclass="container sample center"><divid="triggers-container"><igc-card><igc-card-header><h4slot="title">Default triggers</h4></igc-card-header><igc-card-content><p>
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>.
</p><igc-buttonvariant="outlined"id="triggers-default">Hover over me</igc-button><igc-tooltipanchor="triggers-default">
I am show on pointer enter and hidden on pointer leave and/or click.
</igc-tooltip></igc-card-content></igc-card><igc-card><igc-card-header><h4slot="title">Focus based</h4></igc-card-header><igc-card-content><p>
In this instance, the tooltip is bound to show on its anchor
<strong>focus</strong> and will hide when its anchor is
<strong>blurred</strong>.
</p><p>Try to navigate with a Tab key to the anchor to see the effect.</p><igc-buttonvariant="outlined"id="triggers-focus-blur">Focus me</igc-button><igc-tooltipanchor="triggers-focus-blur"show-delay="0"hide-delay="0"show-triggers="focus"hide-triggers="blur">
I am shown on focus and hidden on blur.
</igc-tooltip></igc-card-content></igc-card><igc-card><igc-card-header><h4slot="title">Same trigger(s) for showing and hiding</h4></igc-card-header><igc-card-content><p>
The same trigger can be bound to both show and hide the tooltip. The
button below has its tooltip bound to show/hide on
<strong>click</strong>.
</p><igc-buttonvariant="outlined"id="triggers-click">Click</igc-button><igc-tooltipshow-delay="0"hide-delay="0"anchor="triggers-click"show-triggers="click"hide-triggers="click">
I am show on click and will hide on anchor click.
</igc-tooltip></igc-card-content></igc-card><igc-card><igc-card-header><h4slot="title">Keyboard interactions</h4></igc-card-header><igc-card-content><p>
Keyboard interactions are also supported. The button below has its
tooltip bound to show on a <strong>keypress</strong> and hide on a
<strong>keypress</strong> or <strong>blur</strong>.
</p><p>Try it out by focusing the button and pressing a key.</p><igc-buttonvariant="outlined"id="triggers-keypress">Press a key</igc-button><igc-tooltipanchor="triggers-keypress"show-triggers="keypress"hide-triggers="keypress blur">
I am shown on a keypress and will hide on a keypress or blur.
</igc-tooltip></igc-card-content></igc-card><igc-card><igc-card-header><h4slot="title">Custom events</h4></igc-card-header><igc-card-content><p>
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>.
</p><igc-inputvariant="outlined"id="triggers-custom"label="Username"></igc-input><igc-tooltipanchor="triggers-custom"show-triggers="igcChange">
Value changed!
</igc-tooltip></igc-card-content></igc-card></div></div></div><!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %>
<scriptsrc="src/index.ts"></script>
<% } %>
</body></html>html
<!DOCTYPE html><html><head><title>Tooltip Styling</title><metacharset="UTF-8" /><linkrel="shortcut icon"href="https://static.infragistics.com/xplatform/images/browsers/wc.png"><linkrel="stylesheet"href="https://fonts.googleapis.com/icon?family=Material+Icons" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Kanit&display=swap" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Titillium Web" /><linkrel="stylesheet"href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css"type="text/css" /></head><body><divid="root"><divclass="container sample center"><igc-avatarid="avatar"src="https://www.infragistics.com/angular-demos-lob/assets/images/avatar/10.jpg"shape="circle"></igc-avatar><igc-tooltipid="tool1"anchor="avatar">Her name is Madelyn James</igc-tooltip></div></div><!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %>
<scriptsrc="src/index.ts"></script>
<% } %>
</body></html>html
/* shared styles are loaded from: *//* https://static.infragistics.com/xplatform/css/samples */css