Skip to content

Commit 74129d7

Browse files
committed
docs: update readme
1 parent 40fc02f commit 74129d7

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,11 @@ Example: pass a footer component that contains a "previous" and "next" button to
8383
| ---------- | --------------- | ---------------------------------------------------------- | -------- | ------- |
8484
| startIndex | number | Indicate the wizard to start at the given step || 0 |
8585
| header | React.ReactNode | Header that is shown above the active step || |
86+
| sidebar | React.ReactNode | Sidebar that is shown after the header, before the active step || |
8687
| footer | React.ReactNode | Footer that is shown below the active stepstep || |
8788
| onStepChange | (stepIndex) | Callback that will be invoked with the new step index when the wizard changes steps || |
88-
| wrapper | React.React.ReactElement | Optional wrapper that is exclusively wrapped around the active step component. It is not wrapped around the `header` and `footer` || |
89+
| wrapper | React.React.ReactElement | Optional wrapper that is exclusively wrapped around the active step component. It is not wrapped around the `header`, `sidebar` and `footer` || |
90+
| sidebarAndStepWrapper | React.React.ReactElement | Optional wrapper that is exclusively wrapped around the sidebar and active step component. It is not wrapped around the `header` and `footer` || |
8991
| children | React.ReactNode | Each child component will be treated as an individual step | ✔️ |
9092

9193
#### Example
@@ -94,19 +96,27 @@ Example: pass a footer component that contains a "previous" and "next" button to
9496
// Example: show the active step in the header
9597
const Header = () => <p>I am the header component</p>;
9698

99+
// Example: show the a sidebar
100+
const Sidebar = () => <p>I am the sidebar component</p>;
101+
97102
// Example: show the "previous" and "next" buttons in the footer
98103
const Footer = () => <p>I am the footer component</p>;
99104

100-
// Example: Wrap steps in an `<AnimatePresence` from framer-motion
105+
// Example: Wrap steps in an `<AnimatePresence` from framer-motion
101106
const Wrapper = () => <AnimatePresence exitBeforeEnter />;
102107

108+
// Example: Wrap sidebar and steps in a Flexbox
109+
const SidebarAndStepWrapper = () => <div class="flex" />;
110+
103111
const App = () => {
104112
return (
105-
<Wizard
113+
<Wizard
106114
startIndex={0}
107115
header={<Header />}
116+
sidebar={<Sidebar />}
108117
footer={<Footer />}
109118
wrapper={<Wrapper />}
119+
sidebarAndStepWrapper={<SidebarAndStepWrapper />}
110120
>
111121
<Step1 />
112122
<Step2 />
@@ -137,6 +147,7 @@ Used to retrieve all methods and properties related to your wizard. Make sure `W
137147
| stepCount | number | The total number of steps of the wizard |
138148
| isFirstStep | boolean | Indicate if the current step is the first step (aka no previous step) |
139149
| isLastStep | boolean | Indicate if the current step is the last step (aka no next step) |
150+
| stepNames | { name: string; number: string }[] | An array of objects for each step in the wizard. Each object has a `name` and `number` property corresponding to the step's name and number. |
140151
| |
141152

142153
#### Example

0 commit comments

Comments
 (0)