Package Exports
- @dry7/ngx-tippy-wrapper
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@dry7/ngx-tippy-wrapper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Documentation
Full documentation you can find in repository
Demo
Installation
Install from npm:
npm i ngx-tippy-wrapper --saveImporting
Import NgxTippyModule:
import { NgxTippyModule } from 'ngx-tippy-wrapper';Then in your base module:
@NgModule({
imports: [
...,
NgxTippyModule
],
...
})Import tippy.css style file to your main style file:
@import 'tippy.js/dist/tippy.css';or angular.json:
"architect": {
"build": {
...,
"options": {
...,
"styles": [..., "./node_modules/tippy.js/dist/tippy.css"]
}Using
Basic usage
Apply ngxTippy directive for element and pass content through data-tippy-content attribute:
<button ngxTippy data-tippy-content="Tooltip content">Element with tooltip</button>Applying props
You can apply props with tippyProps binding
In template:
<button
ngxTippy
data-tippy-content="Tooltip content"
[tippyProps]="{
arrow: false,
placement: 'bottom'
}"
>
Element with tooltip
</button>Or pass props from component:
<span ngxTippy data-tippy-content="Tooltip content" [tippyProps]="tippyProps">
Element with tooltip
</span>...
import { NgxTippyProps } from 'ngx-tippy-wrapper';
@Component({ ... })
export class DemoComponent implements OnInit {
tippyProps: NgxTippyProps = {
trigger: 'click',
allowHTML: true,
};
...
}