Skip to content
This repository has been archived by the owner on Jan 20, 2020. It is now read-only.

makito/ng2-tooltip-directive

 
 

Repository files navigation

Angular2 tooltip directive.

Installation

1 Install the npm package.

npm i ng2-tooltip-directive

2 Import Ng2Module:

import { NgModule }         from '@angular/core';
import { BrowserModule }    from '@angular/platform-browser';
import { AppComponent }     from './app.component';
import { TooltipDirective } from 'ng2-tooltip-directive/components';
 
@NgModule({
    imports:      [ BrowserModule ],
    declarations: [ AppComponent, TooltipDirective ],
    bootstrap:    [ AppComponent ]
})
export class AppModule { } 

3 Add CSS styles

Example CSS: https://github.com/drozhzhin-n-e/ng2-tooltip-directive/blob/master/example/src/styles.css

Usage

<span tooltip="Tooltip" placement="top" show-delay="500">Tooltip on top</span>

Properties

name type description
placement "top", "bottom", "left", "right" The position of the tooltip.
show-delay number The delay in ms before showing the tooltip.
hide-delay number The delay in ms before removing the tooltip.
z-index number Z-index of the tooltip.

Development server

Run ng serve for a dev server. Navigate to https://localhost:4200/.

Demo

https://crystalui.org/components/tooltip

Packages

No packages published

Languages

  • TypeScript 68.0%
  • JavaScript 15.5%
  • CSS 9.6%
  • HTML 6.9%