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
+60-1Lines changed: 60 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,34 @@ Example:
41
41
42
42
<br />
43
43
44
+
# Config Object
45
+
46
+
`Steps` component accepts an optional `config` object for configuring the common navigation component. The `Navigation` component provided in the config object will be rendered along with every step component. Here is an example:
47
+
48
+
```javascript
49
+
constNavigation= (props) => {
50
+
return (
51
+
<div>
52
+
<button onClick={props.prev}>Previous</button>
53
+
<button onClick={props.next}>Next</button>
54
+
</div>
55
+
);
56
+
}
57
+
58
+
constconfig= {
59
+
navigation: {
60
+
component: Navigation // a React component with special props provided automatically
|`<Steps />`| Wrapper component for Step components. |
80
+
|`<Steps />`| Wrapper component for Step components. Accepts a `config` object for rendering a common navigation component.|
53
81
|`<Step />`|`title`: takes a title for the step, which can be accessed in `props` object of the step component. <br />`component`: takes a React component that you would like to show in that step. <br />`beforeStepChange`: takes a callback function to run right before the current step changes. |
54
82
55
83
<br />
@@ -78,6 +106,22 @@ The React component that is passed to each `Step` wrapper component will be inje
78
106
|`props.getState`|`function<key, defaultValue>`| Function to retrieve a state value by key |
79
107
|`props.handleChange`|`function<event>`|`onChange` event handler for form elements |
If you'd like to add a persistent navigation component to be shown on every step, you may utilize `NavigationComponentProps` type for your custom `Navigation` component. Here is an example:
0 commit comments