ionic-react-header-parallax
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

Easy to use hook to handle the parallax effect for IonHeader component in React Ionic.

Overview

Installation with npm

npm install ionic-react-header-parallax --save

Installation with yarn

yarn add ionic-react-header-parallax

Example

import * as React from 'react'
import { IonBackButton, IonButtons, IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react'
import { useIonHeaderParallax } from 'ionic-react-header-parallax'

const Home: React.FC = () => {

   const { ref } = useIonHeaderParallax({
    image: 'https://picsum.photos/1080',
    showBarButtons: true,
  })

  return (
    <IonPage>
      <IonHeader ref={ref}>
        <IonToolbar>
          <IonButtons slot="start">
            <IonBackButton defaultHref="/" />
          </IonButtons>
          <IonTitle>Post Title</IonTitle>
        </IonToolbar>
      </IonHeader>

      <IonContent className="ion-padding-start ion-padding-end">
        {...}
      </IonContent>
    </IonPage>
  )
}

export default Home

API

useIonHeaderParallax

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.3.10latest

Version History

VersionDownloads (Last 7 Days)Published
0.3.10
0.3.00
0.1.80
0.1.70
0.1.60
0.1.50
0.1.40
0.1.30
0.1.20
0.1.10
0.1.00
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30

Package Sidebar

Install

npm i ionic-react-header-parallax

Weekly Downloads

0

Version

0.3.1

License

MIT

Unpacked Size

26.3 kB

Total Files

10

Last publish

Collaborators

  • ahmnouira