Skip to content

Commit 452b6a8

Browse files
committed
add documentation
1 parent e97dda0 commit 452b6a8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,24 @@ copilot({
136136
})(RootComponent)
137137
```
138138

139+
### Custom step number component
140+
You can customize the step number by passing a component to the `copilot` HOC maker. If you are looking for an example step number component, take a look at [the default step number implementation](https://github.com/okgrow/react-native-copilot/blob/master/src/components/StepNumber.js).
141+
142+
```js
143+
const StepNumberComponent = ({
144+
isFirstStep,
145+
isLastStep,
146+
currentStep,
147+
currentStepNumber,
148+
}) => (
149+
// ...
150+
);
151+
152+
copilot({
153+
stepNumberComponent: StepNumberComponent
154+
})(RootComponent)
155+
```
156+
139157
### Custom components as steps
140158
The components wrapped inside `CopilotStep`, will receive a `copilot` prop of type `Object` which the outermost rendered element of the component or the element that you want the tooltip be shown around, must extend.
141159

0 commit comments

Comments
 (0)