angular-tippy
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

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

Package Sidebar

Install

npm i angular-tippy

Weekly Downloads

249

Version

0.0.3

License

Apache-2.0

Unpacked Size

47.5 kB

Total Files

29

Last publish

Collaborators

  • jonrinciari