<IgrTooltipshow-delay="600"hide-delay="800">
Her name is Madelyn James.
</IgrTooltip>tsx
Tooltip API 메서드(show, hide 및 toggle)는 showDelay 및 hideDelay 속성을 고려하지 않는다는 점에 유의해야 합니다. 호출되면 즉시 행동합니다.
배치
또한 IgrTooltipComponent 대상 요소를 기준으로 쉽게 배치할 수 있습니다. 다음 위치 옵션 중 하나와 함께 속성을 사용 placement 하기만 하면 됩니다. top top-start top-end bottom bottom-start bottom-end right right-start right-end left left-start left-end
<IgrButtonid="target-button">Hover me</IgrButton><IgrTooltipanchor="target-button"placement="top-start"sticky>
Congrats you have hovered the button!
</IgrTooltip>tsx
importReactfrom"react";
importReactDOMfrom"react-dom/client";
import"./index.css";
import { IgrTooltip, IgrButton, IgrInput, IgrCard, IgrCardContent, IgrCardHeader } from"@infragistics/igniteui-react";
import"igniteui-webcomponents/themes/light/bootstrap.css";
exportdefaultclass TooltipTriggers extendsReact.Component<any, any> {
constructor(props: any) {
super(props);
}
publicrender(): JSX.Element {
return (
<divclassName="container sample"><divid="triggers-container"><IgrCard><IgrCardHeader><h4slot="title">Default triggers</h4></IgrCardHeader><IgrCardContent><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><IgrButtonvariant="outlined"id="triggers-default">
Hover over me
</IgrButton><IgrTooltipanchor="triggers-default">
I am show on pointer enter and hidden on pointer leave and/or
click.
</IgrTooltip></IgrCardContent></IgrCard><IgrCard><IgrCardHeader><h4slot="title">Focus based</h4></IgrCardHeader><IgrCardContent><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><IgrButtonvariant="outlined"id="triggers-focus-blur">
Focus me
</IgrButton><IgrTooltipanchor="triggers-focus-blur"show-delay="0"hide-delay="0"show-triggers="focus"hide-triggers="blur"
>
I am shown on focus and hidden on blur.
</IgrTooltip></IgrCardContent></IgrCard><IgrCard><IgrCardHeader><h4slot="title">Same trigger(s) for showing and hiding</h4></IgrCardHeader><IgrCardContent><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><IgrButtonvariant="outlined"id="triggers-click">
Click
</IgrButton><IgrTooltipshow-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.
</IgrTooltip></IgrCardContent></IgrCard><IgrCard><IgrCardHeader><h4slot="title">Keyboard interactions</h4></IgrCardHeader><IgrCardContent><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><IgrButtonvariant="outlined"id="triggers-keypress">
Press a key
</IgrButton><IgrTooltipanchor="triggers-keypress"show-triggers="keypress"hide-triggers="keypress blur"
>
I am shown on a keypress and will hide on a keypress or blur.
</IgrTooltip></IgrCardContent></IgrCard><IgrCard><IgrCardHeader><h4slot="title">Custom events</h4></IgrCardHeader><IgrCardContent><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><IgrInputid="triggers-custom"label="Username"></IgrInput><IgrTooltipanchor="triggers-custom"show-triggers="igcChange">
Value changed!
</IgrTooltip></IgrCardContent></IgrCard></div></div>
);
}
}
// rendering above class to the React DOMconstroot = ReactDOM.createRoot(document.getElementById("root"));
root.render(<TooltipTriggers />);
tsx