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: README.md
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,6 +84,7 @@ Example: pass a footer component that contains a "previous" and "next" button to
84
84
| startIndex | number | Indicate the wizard to start at the given step | ❌ | 0 |
85
85
| header | React.ReactNode | Header that is shown above the active step | ❌ ||
86
86
| footer | React.ReactNode | Footer that is shown below the active stepstep | ❌ ||
87
+
| wrapper | React.React.ReactElement | Optional wrapper that is exclusively wrapped around the active step component. It is not wrapped around the `header` and `footer`| ❌ ||
87
88
| children | React.ReactNode | Each child component will be treated as an individual step | ✔️ |
88
89
89
90
#### Example
@@ -95,9 +96,17 @@ const Header = () => <p>I am the header component</p>;
95
96
// Example: show the "previous" and "next" buttons in the footer
96
97
constFooter= () =><p>I am the footer component</p>;
97
98
99
+
// Example: Wrap steps in an `<AnimatePresence` from framer-motion
@@ -236,7 +245,7 @@ If an async function is attached to `handleStep` the `isLoading` property will i
236
245
237
246
Since `react-use-wizard` is focused to manage the logic of a wizard it doesn't mean you can't add some animation by your own. Add any animation library that you like. I highly suggest [framer-motion](https://www.framer.com/motion/) to add your animations.
238
247
239
-
Checkout this [example](https://github.com/devrnt/react-use-wizard/blob/main/playground/components/animatedStep.tsx) to see how a step can be animated with framer motion.
248
+
Checkout this [example](https://github.com/devrnt/react-use-wizard/tree/feat/wizard-wrapper/playground/modules/wizard/animated) to see how a step can be animated with framer motion.
0 commit comments