You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/docs/usage/components/parallax-component.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ const SlowAndFast = () => (
27
27
);
28
28
```
29
29
30
-
**NOTE:** The `speed` prop simplifies the application of a `translateX` or `translateY` effect based on the `ParallaxController` scroll axis [TODO](#link)
30
+
**NOTE:** The `speed` prop simplifies the application of a `translateX` or `translateY` effect based on the `ParallaxController` scroll axis – [See <ParallaxProvider\> Props](/docs/usage/components/parallax-provider#parallaxprovider-props)
The `<ParallaxProvider />` component is meant to wrap a top level component in your application and is necessary to provide access through the React context API to the [parallax controller](https://parallax-controller.vercel.app/docs/intro). This component should only be used once in you app, for instance in an `<AppContainer />` component that won't be mounted/unmounted during route changes. Like so:
3
+
The `<ParallaxProvider />` component is meant to wrap a root level component in your application and is necessary to provide access through the React context API to the [Parallax Controller](https://parallax-controller.vercel.app/docs/intro).
4
+
5
+
## Basic Example
6
+
7
+
This component should only be used once in you app, for instance in an `<AppContainer />` component that won't be mounted/unmounted during route changes. Like so:
**NOTE:** You can have multiple providers, however they will all be independent instances of a `ParallaxController`. It's recommended to only use one when possible.
22
+
15
23
## ParallaxProvider Props
16
24
17
25
The following props configure the `<ParallaxProvider>` component:
|**scrollAxis**|`string`|`vertical`| Optionally pass the scroll axis for setting horizontal/vertical scrolling. One of `vertical` or `horizontal`|
22
-
|**scrollContainer**|`HTMLElement`|`<body>`| Optionally set the container that has overflow and will contain parallax elements. Defaults to the HTML body |
|**scrollAxis**|`string`|`vertical`| Optionally pass the scroll axis for setting horizontal/vertical scrolling. One of `vertical` or `horizontal`|
30
+
|**scrollContainer**|`HTMLElement`|`<body>`| Optionally set the container that has overflow and will contain parallax elements. Defaults to the document scroll body. |
31
+
32
+
## Example: Scroll Container
33
+
34
+
By default the <ParallaxProvider\> defaults to the document scrolling element. If your app's overflow is a unique element you need to provide the element as the `scrollContainer`. Here's how:
0 commit comments