Skip to content

Commit c048f80

Browse files
committed
docs: update docs about Parallax component props
1 parent 5478c87 commit c048f80

File tree

4 files changed

+45
-23
lines changed

4 files changed

+45
-23
lines changed

documentation/docs/migration-guides/v2-migration-guide.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ With mostly just new features, V3 also makes a few breaking changes. See the fol
1010

1111
If you've used any of the following props rename to new ones, or refactor if they are no longer supported.
1212

13-
1. `styleOuter` becomes `style`.
14-
2. `tagOuter` becomes `tag`.
15-
3. `x` becomes `translateX`.
16-
4. `y` becomes `translateY`.
17-
5. `styleInner` is no longer supported - There's only a single element returned by the component.
13+
1. `x` becomes `translateX`.
14+
2. `y` becomes `translateY`.
15+
3. `styleOuter` becomes `style`.
16+
4. `styleInner` is no longer supported - There's only a single element returned by the component.
17+
5. `tagOuter` is no longer supported - If you need a custom element use the `useParallax` hook instead.
1818
6. `tagInner` is no longer supported - There's only a single element returned by the component.
1919

2020
### Using the useController hook.

documentation/docs/usage/components/parallax-banner-component.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
sidebar_position: 3
3+
---
4+
15
# ParallaxBanner
26

37
Component that utilizes `<Parallax>` components to achieve a parallaxing banner effect. Allows a single or multiple images to be parallaxed at different rates within the banner area.

documentation/docs/usage/components/parallax-component.md

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
15
# Parallax
26

37
The main component for applying scroll effects based on an elements position within the viewport.
@@ -6,6 +10,34 @@ The main component for applying scroll effects based on an elements position wit
610
import { Parallax } from 'react-scroll-parallax';
711
```
812

13+
## Props
14+
15+
All props to configure the parallax element, like CSS effects, are documented and managed by the `parallax-controller`.
16+
17+
[See all the parallax props](https://parallax-controller.vercel.app/docs/usage/props) that this component will accept.
18+
19+
### Non Parallax Props
20+
21+
All other non-parallax props will be passed through to the `<div>`. Example with `style` and `className`:
22+
23+
```tsx
24+
<Parallax style={{ background: 'blue' }} className="test" />
25+
```
26+
27+
```html
28+
<div style="background:'blue'" className="test"></div>
29+
```
30+
31+
### Children
32+
33+
Children are also accepted and rendered
34+
35+
```tsx
36+
<Parallax>
37+
<h1>Hello</h1>
38+
</Parallax>
39+
```
40+
941
## Examples
1042

1143
Some basic example of how to use the `<Parallax>` component.
@@ -50,21 +82,3 @@ const TranslateY = () => (
5082
Translate values without units default to `%` so `-20` becomes `-20%`.
5183

5284
:::
53-
54-
## Props
55-
56-
### Props: Effects
57-
58-
Most props to configure a parallax element like CSS effects are documented and managed by the `parallax-controller`.
59-
60-
[See all the parallax props](https://parallax-controller.vercel.app/docs/usage/props) that this component will accept.
61-
62-
### Props: Component Configuration
63-
64-
The following props allow some configuration of the react component:
65-
66-
| Name | Type | Default | Description |
67-
| ------------- | :------: | :------ | ---------------------------------------------------------------------- |
68-
| **className** | `string` | | Class names to be added to the outermost parallax element. |
69-
| **style** | `object` | | Style object to be added to the outermost parallax element. |
70-
| **tag** | `string` | `div` | HTML element tag name to be applied to the outermost parallax element. |

documentation/docs/usage/components/parallax-provider.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
15
# ParallaxProvider
26

37
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).

0 commit comments

Comments
 (0)