![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
ionic-header-parallax
Advanced tools
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.
For Ionic 3 use version 1.1.0 of this package:
$ npm i ionic-header-parallax@1.1.0
.
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.
$ npm i ionic-header-parallax
.appmodule.ts
):import { IonicHeaderParallaxModule } from 'ionic-header-parallax';
@NgModule({
imports: [
IonicHeaderParallaxModule,
...
Just add the attribute parallax
to any <ion-header>
element:
<ion-header parallax></ion-header>
Optional attributes:
imageUrl (string)
: The background image to show while expanded.maximumHeight (number)
: The height for the header when expanded. Default is 200
.expandedColor (string)
: The color (web hex formatted) to show while the header is expanded when no imageUrl
is set. When scrolled it will fade to the navbar/toolbar's color or the one configured in <toolbar color="">
attribute.titleColor (string)
: The text color (web hex formatted) for <ion-title>
and <ion-back-button>
elements when expanded. They will turn to their default color on cover collapse.Example:
<ion-header parallax imageUrl="https://picsum.photos/350" maximumHeight="350" expandedColor="#AAA" titleColor="white">
<ion-toolbar color="primary">
<ion-title>
Parallax Header
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
Some content here
</ion-content>
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. Contributions are very welcome. Find the instructions in the CONTRIBUTING.md file.
Feel free to improve the code!
Raschid JF. Rafaelly
This is an adaptation of this awesome tutorial on v2 by Josh Morony. Thanks.
FAQs
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.
The npm package ionic-header-parallax receives a total of 32 weekly downloads. As such, ionic-header-parallax popularity was classified as not popular.
We found that ionic-header-parallax demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.