Skip to content

Commit 9314132

Browse files
committed
Reorganize README and add release documentation
Move TypeScript, Custom Backgrounds, and Custom Components sections out of the intro area into more appropriate locations. Add release instructions under Contributing and add react-native-slider-intro to Related Work.
1 parent d859853 commit 9314132

File tree

1 file changed

+50
-40
lines changed

1 file changed

+50
-40
lines changed

README.md

Lines changed: 50 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ Your new users shouldn't jump in at the deep end. First give them a pleasurable,
1111

1212
Getting everything running merely takes a minute. Try out the example [running in your browser](https://snack.expo.io/dlQTGD06P). Or check out this [tutorial on YouTube](https://www.youtube.com/watch?v=SMkR-iIGvwQ).
1313

14-
## TypeScript
15-
16-
This library ships with built-in TypeScript declarations. No additional `@types` package is needed.
17-
1814
## Install
1915

2016
```bash
@@ -43,39 +39,6 @@ import Onboarding from 'react-native-onboarding-swiper';
4339
/>
4440
```
4541

46-
## Custom Backgrounds
47-
48-
You can use any React element as a page background (e.g. a linear gradient) via the `background` prop. Pair it with `isLight` to control text/dot colors since the library can't auto-detect brightness from a gradient.
49-
50-
```js
51-
import LinearGradient from 'react-native-linear-gradient';
52-
53-
<Onboarding
54-
pages={[
55-
{
56-
background: (
57-
<LinearGradient
58-
colors={['#003c8f', '#5a9bf6']}
59-
style={{ flex: 1 }}
60-
/>
61-
),
62-
isLight: false,
63-
image: <Image source={require('./images/circle.png')} />,
64-
title: 'Gradient Page',
65-
subtitle: 'Using a custom background element',
66-
},
67-
{
68-
backgroundColor: '#e9bcbe',
69-
image: <Image source={require('./images/square.png')} />,
70-
title: 'Solid Color Page',
71-
subtitle: 'Still works the same as before',
72-
},
73-
]}
74-
/>
75-
```
76-
77-
You can also combine both `backgroundColor` and `background` on the same page — the solid color provides smooth animated transitions while the gradient covers it visually.
78-
7942
## Examples
8043

8144
Check out the three examples files: the [simple example](examples/Simple.js), the [example with a Call-to-Action button](examples/WithCTA.js) or the [example with custom button components](examples/CustomButtons.js).
@@ -168,16 +131,49 @@ For each page in the `pages` array, you can override the default page styles. [A
168131
* `titleStyles` (optional): modify styles of a specific page's title.
169132
* `subTitleStyles` (optional): modify styles of a specific page's subtitle.
170133

171-
## Custom Components Properties
134+
### Custom Components
172135

173-
You can also provide your own custom components for the buttons and the dots. All of them have access to a `isLight` prop but it's up to you what you do with it. Also checkout [this example](examples/CustomButtons.js).
136+
You can provide your own custom components for the buttons and the dots. All of them have access to a `isLight` prop but it's up to you what you do with it. Also checkout [this example](examples/CustomButtons.js).
174137

175138
* `SkipButtonComponent` (optional): Skip Button, gets `skipLabel` as prop.
176139
* `NextButtonComponent` (optional): Next Button, gets `nextLabel` as prop.
177140
* `DoneButtonComponent` (optional): Done Button.
178141
* `DotComponent` (optional): Dot for the pagination, gets `selected` as prop to indicate the active page.
179142

180-
## Controlling the pages imperatively
143+
### Custom Backgrounds
144+
145+
You can use any React element as a page background (e.g. a linear gradient) via the `background` prop. Pair it with `isLight` to control text/dot colors since the library can't auto-detect brightness from a gradient.
146+
147+
```js
148+
import LinearGradient from 'react-native-linear-gradient';
149+
150+
<Onboarding
151+
pages={[
152+
{
153+
background: (
154+
<LinearGradient
155+
colors={['#003c8f', '#5a9bf6']}
156+
style={{ flex: 1 }}
157+
/>
158+
),
159+
isLight: false,
160+
image: <Image source={require('./images/circle.png')} />,
161+
title: 'Gradient Page',
162+
subtitle: 'Using a custom background element',
163+
},
164+
{
165+
backgroundColor: '#e9bcbe',
166+
image: <Image source={require('./images/square.png')} />,
167+
title: 'Solid Color Page',
168+
subtitle: 'Still works the same as before',
169+
},
170+
]}
171+
/>
172+
```
173+
174+
You can also combine both `backgroundColor` and `background` on the same page — the solid color provides smooth animated transitions while the gradient covers it visually.
175+
176+
## Controlling the pages imperatively
181177

182178
You can control the Onboarding component imperatively with [useRef](https://reactjs.org/docs/hooks-reference.html#useref).
183179

@@ -226,16 +222,30 @@ const OnboardingScreen = () => {
226222
};
227223
```
228224

225+
## TypeScript
226+
227+
Built-in TypeScript declarations are included. No additional `@types` package is needed.
228+
229229
## Contributing
230230

231231
If you have a **question**, found a **bug** or want to propose a new **feature**, have a look at the [issues page](https://github.com/jfilter/react-native-onboarding-swiper/issues).
232232

233233
**Pull requests** are especially welcomed when they fix bugs or improve the code quality.
234234

235+
### Releasing a new version
236+
237+
1. Update the version in `package.json`.
238+
2. Add an entry to `CHANGELOG.md` with the new version number and a summary of changes.
239+
3. Commit: `git commit -am "vX.Y.Z"`.
240+
4. Tag: `git tag vX.Y.Z`.
241+
5. Push: `git push && git push --tags`.
242+
6. Publish: `npm publish`.
243+
235244
## Related Work
236245

237246
* https://github.com/jacse/react-native-app-intro-slider
238247
* https://github.com/gorhom/react-native-paper-onboarding
248+
* https://github.com/RichardRNStudio/react-native-slider-intro
239249

240250
## Acknowledgements
241251

0 commit comments

Comments
 (0)