🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

ionic-header-parallax

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ionic-header-parallax

This directive enables parallax effect on `ion-header` elements to display a cover photo while on top of the page and transition it to the normal navbar when content is scrolled down.

6.0.0
Source
npm
Version published
Weekly downloads
37
2.78%
Maintainers
0
Weekly downloads
 
Created
Source

Parallax Header Directive for Ionic

This directive enables parallax effect on ion-header elements to display a cover photo while on top of the page and transition it to the normal navbar when content is scrolled down.

Compatibility

StackTag
6.x.x
5.x.x
4.x.x
3.x.x
2.x.x

Live Demo

Checkout the Live Demo here

iOSAndroid

Set Up

  • Install package: npm i ionic-header-parallax.
  • Import the directive into your desired module (usually appmodule.ts):
import { IonicHeaderParallaxModule } from 'ionic-header-parallax';

@NgModule({
  imports: [
    IonicHeaderParallaxModule,
    ...

Usage

Just add the attribute parallax to any <ion-header> element:

<ion-header parallax imageUrl="https://picsum.photos/350" height="350" bgPosition="top">
  <ion-toolbar color="primary">
    <ion-title> Parallax Header </ion-title>
  </ion-toolbar>
</ion-header>

<ion-content> Some content here </ion-content>
ParameterTypeDescription
imageUrlstringThe background image to show while expanded.
height number | stringThe height for the header when expanded. If the value is a number, it will be set in px. If the value is a string it will be passed as is (eg: "20rem")
colorstringThe color (web hex formatted) to show while the header is expanded when no imageUrl is set. When scrolled, it will fade to the toolbar's color.
bgPosition'top' | 'center' | 'bottom'The position of the image in the header. This parameter slightly changes the feeling of the animation. Default: 'top'

Contributing

I don't plan to be maintaining this package full-time, but as I'm usually developing in Ionic I'll be glad to update it any time I make some upgrades for myself. Code contributions, issues, and PRs are very welcome. Find the instructions in the CONTRIBUTING.md file.

Keywords

ionic

FAQs

Package last updated on 26 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts