A dependency free React Native component to render dashed/dotted lines
npm install react-native-dashed-line
A dependency free React Native component to render dashed/dotted lines
- Installation
- Usage Guide
- API Reference
- Contributing
You can install via Yarn or npm
``bash`
yarn add react-native-dashed-line
`bash`
npm install react-native-dashed-line
Just need to import it, easy peasy!
`javascript
import DashedLine from 'react-native-dashed-line';
return (
);
`

Here is a list of all of the props that react-native-dashed-line can accept
Axis of the line, can be either horizontal or vertical. Defaults to horionztal.
| type | default | required |
| ------ | ---------- | -------- |
| string | horizontal | NO |
Length of the gap in pixels between each dash, defaults to 2.
| type | default | required |
| ------ | ------- | -------- |
| number | 2 | NO |
Length of each dash stroke in pixels, defaults to 4.
| type | default | required |
| ------ | ------- | -------- |
| number | 4 | NO |
Defines the thickness of each dash stroke in pixels, defaults to 2.
| type | default | required |
| ------ | ------- | -------- |
| number | 2 | NO |
Defines the color of the dashed line, defaults to Black #000`. Any valid React Native colour can be provided.
| type | default | required |
| ------ | ------- | -------- |
| string | #000 | NO |
Allows for custom View styles to be passed to each dash.
| type | required |
| --------------- | -------- |
| Object \| Array | NO |
Allows for custom View styles to be passed to each dashed line container.
| type | required |
| --------------- | -------- |
| Object \| Array | NO |
I am more than happy to accept any contributions anyone would like to make, whether that's raising an issue, suggesting an improvement or developing a new feature.