New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-view

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-view

A lightweight View component for React Native

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
33
increased by13.79%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-view

A lightweight View component that can be styled quickly.

Installation

$ npm install react-native-view --save

then

import View from 'react-native-view';
/*...*/
<View vcenter hcenter>
/*...*/
</View>

Usage

Align content

Example
  • center children horizontally
<View hcenter>
/*...*/
</View>

alt text

  • align children to the left
<View hstart>
/*...*/
</View>

alt text

  • center children horizontally and vertically
<View vcenter hcenter>
/*...*/
</View>

alt text

Available props:

propdescription
hstartAlign children to the left
hcenterCenter children horizontally
hendAlign children to the right
vstartAlign children to the top
vcenterCenter children vertically
vendAlign children to the bottom
flexApply flex: 1
rowBecomes a row (column by default)
stretchStretch the view to fill parent
spreadSpread children evenly along the orientation with padding
pushSpread children evenly along the orientation without padding

More examples:

  • spread
<View spread hcenter>
/*...*/
</View>

alt text

  • push
<View push hcenter>
/*...*/
</View>

alt text

Padding

By default paddings can be set using breakpoints:

namevalue in px
sm5
md15
lg30
xl45

Also, you can specify where paddings are applied using directional suffixes: l - left | r - right | t - top | b - bottom:

Example
  • 15px padding top and left
<View mdpt mdpl>
</View>

alt text

  • 5px padding on all sides
<View smp>
</View>

alt text

License

MIT

Keywords

FAQs

Package last updated on 02 Oct 2017

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc