Taiga UI 5.0 is out!

Present KIT

GitHub

tuiPresent allows to detect appearance of elements in DOM

Basic

Hover

Counter of component appearance minus counter of its disappearance:

CSS: 0

ngIf: 0

    
      
    
    
      <p (tuiHoveredChange)="onHovered($event)">
    Hover
    <span
        [class.hidden]="!hovered"
        (tuiPresent)="onCSS($event)"
    >
        I am a component hidden with CSS
    </span>
    @if (hovered) {
        <span (tuiPresent)="onIf($event)">I am a component hidden with *ngIf</span>
    }
</p>
<p>Counter of component appearance minus counter of its disappearance:</p>
<p>
    CSS:
    <span tuiBadge>{{ counterCSS }}</span>
</p>
<p>
    ngIf:
    <span tuiBadge>{{ counterIf }}</span>
</p>

    
    
      .hidden {
    display: none;
}