angular-tippy

This is a wrapper around the Tippy.js. Easily create tooltips using a directive or utilize the service

Usage no npm install needed!

<script type="module">
  import angularTippy from 'https://cdn.skypack.dev/angular-tippy';
</script>

README

Angular Tippy.JS Directive & Service

This is a wrapper around the Tippy.js. Easily create tooltips using a directive or utilize the service

Installation

Install Using NPM

  npm install --save angular-tippy

Adding Module


import { AppComponent } from './app.component';
import { NgTippyModule } from 'ng-tippy';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    NgTippyModule
  ],
  exports: [],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Usage as a Service

import { NgTippyService, Instance} from 'ng-tippy';

  @Component({
    selector: 'app-test',
    template: `
      <div #element> </div>
    `
  })
  export class TestComponent implements OnInit {
    @ViewChild('element') element: ElementRef;
    private options = {
      content: 'This is a basic popup'
    }
    private tippyInstance: Instance;
    constructor(
      private tippy: NgTippyService;
    ) {

    }

    ngOnInit() {
      this.tippyInstance = this.tippy.init(this.element, this.options);
      this.tippyInstance.show(3000);
    }
  }

Usage as a directive

  const config = {
    content: 'This is a basic Popup'
  }
  <div *ngTippy="config"> 
    
  </div>

API

Check out the full documentation for the configuration at the official documents Tippy.js

License

Apache License Version 2.0, January 2004