Socket
Book a DemoInstallSign in
Socket

react-native-dashed-line

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-dashed-line

A dependency free React Native component to render dashed/dotted lines

1.1.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

React Native Dashed Line

A dependency free React Native component to render dashed/dotted lines

Current npm package version. Bundle size react-native-dashed-line is released under the MIT license.


Contents


Installation

You can install via Yarn or npm

yarn add react-native-dashed-line
npm install react-native-dashed-line

Usage Guide

Just need to import it, easy peasy!

import DashedLine from 'react-native-dashed-line';

return (
  <View style={{ padding: '5%', height: '100%' }}>
    <DashedLine dashLength={5} />

    <DashedLine dashLength={10} dashThickness={8} />

    <DashedLine dashLength={10} dashThickness={8} dashGap={5} />

    <DashedLine dashLength={10} dashThickness={8} dashGap={5} dashColor='#c32626' />

    <DashedLine dashLength={10} dashThickness={8} dashGap={5} dashColor='#c32626' dashStyle={{ borderRadius: 5 }} />

    <DashedLine axis='vertical' dashLength={5} />
  </View>
);
Example screenshot

API Reference

Here is a list of all of the props that react-native-dashed-line can accept

axis

Axis of the line, can be either horizontal or vertical. Defaults to horionztal.

typedefaultrequired
stringhorizontalNO

dashGap

Length of the gap in pixels between each dash, defaults to 2.

typedefaultrequired
number2NO

dashLength

Length of each dash stroke in pixels, defaults to 4.

typedefaultrequired
number4NO

dashThickness

Defines the thickness of each dash stroke in pixels, defaults to 2.

typedefaultrequired
number2NO

dashColor

Defines the color of the dashed line, defaults to Black #000. Any valid React Native colour can be provided.

typedefaultrequired
string#000NO

dashStyle

Allows for custom View styles to be passed to each dash.

typerequired
Object | ArrayNO

style

Allows for custom View styles to be passed to each dashed line container.

typerequired
Object | ArrayNO

Contributing

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.

Keywords

react-native

FAQs

Package last updated on 27 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.