npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ionic3-hidenav

v2.0.1

Published

A simple navbar auto-hide module for ionic 3

Downloads

4

Readme

Hide Navigation Bar for Ionic 3

NPM version

HideNavbar is an angular directive for hardware accelerated navigation bar transitions while scrolling. There are two modes available, one with supertabs and one for normal pages.

Also: Check out the new Hidenav module for Ionic4!

How to install

npm i ionic3-hidenav

Adding Hidenav to Ionic Project

Update your app.module.ts as follows:

import {BrowserModule} from '@angular/platform-browser';
import {ErrorHandler, NgModule} from '@angular/core';
import {IonicApp, IonicErrorHandler, IonicModule} from 'ionic-angular';

import {MyApp} from './app.component';
import {HomePage} from '../pages/home/home';

import {HidenavModule} from "ionic3-hidenav";

@NgModule({
    declarations: [
        MyApp,
        HomePage
    ],
    imports: [
        BrowserModule,
        IonicModule.forRoot(MyApp),
        HidenavModule.forRoot() //<-- add this to your app module
    ],
    bootstrap: [IonicApp],
    entryComponents: [
        MyApp,
        HomePage
    ],
    providers: [
        StatusBar,
        SplashScreen,
        {provide: ErrorHandler, useClass: IonicErrorHandler}
    ]
})
export class AppModule {
}

if you're using lazy loading make sure to also import HidenavModule either globally using a shared.module.ts or in the each page module you're planning to use it on:

newsstack.module.ts

import {NgModule} from '@angular/core';
import {IonicPageModule} from 'ionic-angular';
import {NewsstackPage} from './newsstack';
import {HidenavModule} from "../../widgets/hidenav/hidenav.module";

@NgModule({
    declarations: [
        NewsstackPage,
    ],
    imports: [
        IonicPageModule.forChild(NewsstackPage),
        HidenavModule //<-- add this to your page module
    ],
})
export class NewsstackPageModule {
}

Usage

In order to use the component in your project you need to specify the components which need to interact with each other to achieve the desired behavior. There are two main actors which we need to choose: ion-content and ion-header and give them the directives hidenav-content and hidenav-header respectively. If you are planning to use the component on a supertabs page you will need to specify these components on different pages. more on that under using with zyra/ionic2-super-tabs below.

home.html

<ion-header hidenav-header>
  <ion-navbar>
    <ion-title>
      Ionic Blank
    </ion-title>
  </ion-navbar>
</ion-header>

<ion-content hidenav-content>
  <!-- long enough content to scroll -->
  .....
</ion-content>

using with zyra/ionic2-super-tabs

If you don't already know what supertabs are, it's an amazing project by Ibby Hadeed made to enable users to add swipeable tabs in their Ionic projects, check out the repo.

it gets tricky to manage hiding navigation with tabs on, the reason behind it is that links will stretch out on several pages. First you need to specify the ion-content and ion-header on the tabs page with the directives hidenav-tabscontent and hidenav-header:

tabs.html

<ion-header hidenav-header>

  <ion-navbar>
    <ion-title>tabs</ion-title>
  </ion-navbar>

</ion-header>

<ion-content hidenav-tabscontent>
  <super-tabs>
    <super-tab [root]="page1" title="First page"></super-tab>
    <super-tab [root]="page2" title="Second page"></super-tab>
    <super-tab [root]="page3" title="Third page"></super-tab>
  </super-tabs>
</ion-content>

then you need to link the tabspage with each underlying page you want to use the hidenav function with using the hidenav-content and hidenav-tabspage directives together.

page1.html

<ion-content hidenav-content hidenav-tabspage>
  <!-- enough content to scroll -->
</ion-content>

Thats it, enjoy!