All Projects → dwicao → react-native-dimension

dwicao / react-native-dimension

Licence: other
A React Native Dimension for Responsive Layout

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-native-dimension

vue-smooth-height
Transition an elements height in response to data changes
Stars: ✭ 40 (+29.03%)
Mutual labels:  height, auto
python-autoclass
A python 3 library providing functions and decorators to automatically generate class code, such as constructor body or properties getters/setters along with optional support of validation contracts on the generated setters. Its objective is to reduce the amount of copy/paste code in your classes - and hence to help reducing human mistakes :).
Stars: ✭ 30 (-3.23%)
Mutual labels:  auto
vue-auto-form
A vue2 component that helpers to easily create basic forms with automatic insert and update events, and automatic reactive validation.
Stars: ✭ 39 (+25.81%)
Mutual labels:  auto
gatsby-netlifycms-starter-template
All the technologies used are free and open-source. You are free to use this template for a personal hobby blog, a commercial news agency or professional journalist website etc. Don't forget to star the repo if you like this template.
Stars: ✭ 33 (+6.45%)
Mutual labels:  responsive
beercss
Build material design interfaces in record time... without stress for devs... 🍺💛
Stars: ✭ 223 (+619.35%)
Mutual labels:  responsive
science-fiction-magazines-blog
Blog template (concept) is inspired by stylish science fiction magazines of the 80-90s.
Stars: ✭ 24 (-22.58%)
Mutual labels:  responsive
auto-dark-mode
IDEA plugin to automatically apply system theme settings on macOS and Windows.
Stars: ✭ 35 (+12.9%)
Mutual labels:  auto
hamibot-auto xuexiqiangguo
每日拿满63分!免root,四人赛双人对战秒答,安卓端学习强国自动化脚本
Stars: ✭ 1,132 (+3551.61%)
Mutual labels:  auto
use-breakpoint
React `useBreakpoint` hook to have different values for a variable based on a breakpoints.
Stars: ✭ 17 (-45.16%)
Mutual labels:  responsive
react-native-measure-text
Measure text width and/or height without laying it out.
Stars: ✭ 105 (+238.71%)
Mutual labels:  height
forest-templates
Source for https://semantic-ui-forest.com/templates/
Stars: ✭ 58 (+87.1%)
Mutual labels:  responsive
Randomly-Adding-Anything
No description or website provided.
Stars: ✭ 42 (+35.48%)
Mutual labels:  dimensions
Bumblezone-Fabric
Fabric port of The Bumblezone!
Stars: ✭ 29 (-6.45%)
Mutual labels:  dimension
react-auto-mosaic
Automatic box behavior in the grid - responsive mosaic
Stars: ✭ 12 (-61.29%)
Mutual labels:  responsive
Sitegeist.Kaleidoscope
Responsive Images for Neos CMS
Stars: ✭ 27 (-12.9%)
Mutual labels:  responsive
global-upvote
A progressive web app that provides top voted stories across the web, summarized and updated every sixty seconds.
Stars: ✭ 25 (-19.35%)
Mutual labels:  responsive
advanced-responsive-video-embedder
Probably the the best WP plugin for embedding videos.
Stars: ✭ 32 (+3.23%)
Mutual labels:  responsive
terrain generator
A wizard that generates terrains for Gazebo using height maps.
Stars: ✭ 46 (+48.39%)
Mutual labels:  auto
40-lines-of-Sass
Full featured flexbox grid in 40 lines of Sass
Stars: ✭ 20 (-35.48%)
Mutual labels:  responsive
FlexBoxFX
FlexBoxFX is a JavaFX implementation of CSS3 flexbox.
Stars: ✭ 65 (+109.68%)
Mutual labels:  responsive

react-native-dimension

Although this package is designed for React Native, it also works on Expo.

Introduction

As a web developer we tend to use like width: 50% or height: 70%
With this package you are able to give style your React Native Component easily
By just { width: width(50) } or { height: height(70) }
Or you could give a size of your font to be a total of screen size
Like { fontSize: totalSize(2) } (this means the font size will be 2% of your total size of the screen)
See example usage below for more details

Installation

  • npm install --save react-native-dimension

Usage

import React, { Component } from 'react';
import {
  StyleSheet,
  Text,
  View,
} from 'react-native';
import { width, height, totalSize } from 'react-native-dimension';

class MyExample extends Component {
  render() {
    return (
      <View style={styles.container}>
        <View style={styles.textWrapper}>
          <Text style={styles.myText}>Yeah... This is awesome!</Text>
        </View>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    marginTop: 20,
  },
  textWrapper: {
    height: height(70), // 70% of height device screen
    width: width(80), // 80% of width device screen
    backgroundColor: 'yellow',
  },
  myText: {
    fontSize: totalSize(2) // 2% of total screen size
  }
});

export default MyExample;

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].