All Projects → MrFrankel → Ngx Popper

MrFrankel / Ngx Popper

Licence: mit
An angular wrapper for popper.js, great for tooltips and positioning popping elements

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Ngx Popper

Angular Development With Primeng
Code samples from the book "Angular UI Development with PrimeNG"
Stars: ✭ 159 (-13.11%)
Mutual labels:  angular2, angular4
Ngx Daterangepicker Material
Pure Angular 2+ date range picker with material design theme, a demo here:
Stars: ✭ 169 (-7.65%)
Mutual labels:  angular2, angular4
Balloon
🎈 Modernized and sophisticated tooltips, fully customizable with an arrow and animations on Android.
Stars: ✭ 2,242 (+1125.14%)
Mutual labels:  tooltip, tooltips
Ngx Qrcode
An Angular 9/10 Component Library for Generating QR (Quick Response) Codes
Stars: ✭ 161 (-12.02%)
Mutual labels:  angular2, angular4
Angular Google Maps
Angular 2+ Google Maps Components
Stars: ✭ 1,982 (+983.06%)
Mutual labels:  angular2, angular4
Ngx Socket Io
Socket.IO module for Angular
Stars: ✭ 178 (-2.73%)
Mutual labels:  angular2, angular4
Ngx Gauge
A highly customizable Gauge component for Angular 9+ apps and dashboards
Stars: ✭ 158 (-13.66%)
Mutual labels:  angular2, angular4
Ionic3 Components
A project full of ionic 3 components and samples - to make life easier :)
Stars: ✭ 1,689 (+822.95%)
Mutual labels:  angular2, angular4
Ionic2 Rating
⭐️ Angular star rating bar. Built for Ionic 2+.
Stars: ✭ 177 (-3.28%)
Mutual labels:  angular2, angular4
Angular2 Crud Rest
Sample Angular (2.x and 4.x) app: CRUD example + routing
Stars: ✭ 152 (-16.94%)
Mutual labels:  angular2, angular4
Angular Notifier
A well designed, fully animated, highly customizable, and easy-to-use notification library for your Angular application.
Stars: ✭ 175 (-4.37%)
Mutual labels:  angular2, angular4
React Popper
🍿⚛Official React library to use Popper, the positioning library
Stars: ✭ 2,173 (+1087.43%)
Mutual labels:  tooltip, tooltips
Ionic2 Pokedex
🎮 Pokédex sample app developed with Ionic 2, Angular 2 and Apache Cordova. Using Pokéapi as source for data.
Stars: ✭ 143 (-21.86%)
Mutual labels:  angular2, angular4
Angular Truffle Starter Dapp
Angular CLI + Truffle Starter Dapp; write, compile & deploy smart contracts on Ethereum blockchains
Stars: ✭ 174 (-4.92%)
Mutual labels:  angular2, angular4
Amazing Time Picker
Timepicker (Clock Picker) for Angular 2, Angular 4 and Angular 5, Angular 6, Angular 7 - Compatible with Angular Material
Stars: ✭ 142 (-22.4%)
Mutual labels:  angular2, angular4
Angular5 Iot Dashboard
Multipurpose dashboard admin for IoT softwares, remote control, user interface. Develop your client dashboards in Angular 5 with vast variety of components available.
Stars: ✭ 148 (-19.13%)
Mutual labels:  angular2, angular4
Ngx Config
Configuration utility for Angular
Stars: ✭ 135 (-26.23%)
Mutual labels:  angular2, angular4
Ng2 Search Filter
Angular 2 / Angular 4 / Angular 5 custom pipe npm module to make a search filter on any input, 🔥 100K+ downloads
Stars: ✭ 137 (-25.14%)
Mutual labels:  angular2, angular4
Ng2 Pdfjs Viewer
An angular 8 component for PDFJS and ViewerJS (Supports angular 2/4/5/6/7)
Stars: ✭ 150 (-18.03%)
Mutual labels:  angular2, angular4
Popover
Angular CDK Popover, no default style, examples using @angular/material
Stars: ✭ 156 (-14.75%)
Mutual labels:  tooltip, angular4

ngx-popper

npm npm MIT licensed Greenkeeper badge Stable Release Size Stable Release Size Build Status

ngx-popper is an angular wrapper for the Popper.js library.

Changes

As of version 6.0.0 popper content runs in onPush change detection strategy, therefore forceChangeDetection is no longer necessary and is removed

As of version 4.0.0 ngx-popper now use innerHTML binding for string popper i.e:

<div popper="some text"></div>

This should make no difference but you should be aware.

As of version 4.0.0 popper.model is now popper-model, due to some angular-cli issues, if you are referencing this please update your references.

Installation

node and npm are required to run this package.

  1. Use npm/yarn to install the package:
$ npm install popper.js --save
$ npm install ngx-popper --save 

Or

 $ yarn add popper.js --save
 $ yarn add ngx-popper --save 
  1. You simply add into your module NgxPopperModule:
import {NgxPopperModule} from 'ngx-popper';

@NgModule({
 // ...
 imports: [
   // ...
   NgxPopperModule
 ]
})

SystemJS

    System.config({
        paths: {
            // paths serve as alias
            'npm:': 'libs/'
        },
        // map tells the System loader where to look for things
        map: {
            ... ,
            'ngx-popper': 'npm:ngx-popper',
            'popper-directive.js': 'npm:ngx-popper',
            'popper.module': 'npm:ngx-popper',
        },
        // packages tells the System loader how to load when no filename and/or no extension
        packages: {
            ... ,
            'ngx-popper': {
                main: 'index.js',
                defaultExtension: 'js'
            },
            'popper.js': {
                main: 'popper-directive.js',
                defaultExtension: 'js'
            },
            'popper.module': {
                main: './popper.module.js',
                defaultExtension: 'js'
            }
        }
    });

  1. Add to view:
 <div     [popper]="popper1Content"
          [popperShowOnStart]="true"
          [popperTrigger]="'click'"
          [popperHideOnClickOutside]="true"
          [popperHideOnScroll]="true"
          [popperPlacement]="'bottom'">
       <p class="bold">Hey!</p>
       <p class="thin">Choose where to put your popper!</p>         
     </div>
     <popper-content #popper1Content>
       <p class="bold">Popper on bottom</p>
     </popper-content>
  1. As text:
     <div [popper]="'As text'"
          [popperTrigger]="'hover'"
          [popperPlacement]="'bottom'"
          (popperOnShown)="onShown($event)">
       <p class="bold">Pop</p>
       <p class="thin">on the bottom</p>
     </div>
     <div popper="{{someTextProperty}}"
          [popperTrigger]="'hover'"
          [popperPlacement]="'bottom'"
          [popperStyles]="{'background-color: 'blue''}",
          (popperOnShown)="onShown($event)">
       <p class="bold">Pop</p>
       <p class="thin">on the bottom</p>
     </div>
  1. Position fixed, breaking overflow:
     <div [popper]="'As text'"
          [popperTrigger]="'hover'"
          [popperPlacement]="'bottom'"
          [popperPositionFixed]="true"
          (popperOnShown)="onShown($event)">
     </div>
  1. Specific target:
<div class="example">
     <div #popperTargetElement></div>
     <div [popper]="'As text'"
          [popperTrigger]="'hover'"
          [popperPlacement]="'bottom'"
          [popperTarget]="popperTargetElement.nativeElement"
          (popperOnShown)="onShown($event)">
     </div>
  1. hide/show programmatically:
 <div [popper]="tooltipcontent"
         [popperTrigger]="'hover'"
         [popperPlacement]="'bottom'"
         [popperApplyClass]="'popperSpecialStyle'">
      <p class="bold">Pop</p>
      <p class="thin">on the bottom</p>
    </div>
    <popper-content #tooltipcontent>
      <div>
        <p>This is a tooltip with text</p>
        <span (click)="tooltipcontent.hide()">Close</span>
      </div>
    </popper-content>
  1. Attributes map:

    Option Type Default Description
    popperDisableAnimation boolean false Disable the default animation on show/hide
    popperDisableStyle boolean false Disable the default styling
    popperDisabled boolean false Disable the popper, ignore all events
    popperDelay number 0 Delay time until popper it shown
    popperTimeout number 0 Set delay before the popper is hidden
    popperTimeoutAfterShow number 0 Set a time on which the popper will be hidden after it is shown
    popperPlacement Placement(string) auto The placement to show the popper relative to the reference element
    popperTarget HtmlElement auto Specify a different reference element other the the one hosting the directive
    popperBoundaries string(selector) undefined Specify a selector to serve as the boundaries of the element
    popperShowOnStart boolean false Popper default to show
    popperTrigger Trigger(string) hover Trigger/Event on which to show/hide the popper
    popperPositionFixed boolean false Set the popper element to use position: fixed
    popperAppendTo string undefined append The popper-content element to a given selector, if multiple will apply to first
    popperPreventOverflow boolean undefined Prevent the popper from being positioned outside the boundary
    popperHideOnClickOutside boolean true Popper will hide on a click outside
    popperHideOnScroll boolean false Popper will hide on scroll
    popperHideOnMouseLeave boolean false Popper will hide on mouse leave
    popperModifiers popperModifier undefined popper.js custom modifiers hock
    popperApplyClass string undefined list of comma separated class to apply on ngpx__container
    popperStyles Object undefined Apply the styles object, aligned with ngStyles
    popperApplyArrowClass string undefined list of comma separated class to apply on ngpx__arrow
    popperOnShown EventEmitter<> $event Event handler when popper is shown
    popperOnHidden EventEmitter<> $event Event handler when popper is hidden
    popperOnUpdate EventEmitter<> $event Event handler when popper is updated
    popperAriaDescribeBy string undefined Define value for aria-describeby attribute
    popperAriaRole string popper Define value for aria-role attribute
  2. Override defaults:

    Ngx-popper comes with a few default properties you can override in default to effect all instances These are overridden by any child attributes.

NgModule({
  imports: [
    BrowserModule,
    FormsModule,
    NgxPopperModule.forRoot({placement: 'bottom'})],
  declarations: [AppComponent],
  providers: [],
  bootstrap: [AppComponent]

})
Options Type Default
showDelay               number           0      
disableAnimation boolean false
disableDefaultStyling boolean false
placement Placement(string) auto
boundariesElement string(selector) undefined
trigger Trigger(string) hover
popperModifiers popperModifier undefined
positionFixed boolean false
hideOnClickOutside boolean true
hideOnMouseLeave boolean false
hideOnScroll boolean false
applyClass string undefined
styles Object undefined
applyArrowClass string undefined
ariaDescribeBy string undefined
ariaRole string undefined
appendTo string undefined
preventOverflow boolean undefined
  1. popperPlacement:

| 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'bottom-start' | 'left-start' | 'right-start' | 'top-end' | 'bottom-end' | 'left-end' | 'right-end' | 'auto' | 'auto-start' | 'auto-end' | Function

  1. popperTrigger:

| 'click' | 'mousedown' | 'hover' | 'none'

Demo

Demo

Contribute

Hell ya!!!

  $ npm install
  $ npm run build
  $ npm run dev  //run example
  $ npm run start_test  //run tests
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].