npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@farfarawaylabs/react-native-easy-flex

v1.0.4

Published

Easy flex controls for React Native

Downloads

8

Readme

@farfarawaylabs/react-native-easy-flex

Layout components for React Native

Layout

Maybe I'm the only one, but for some reason I just keep forgetting which flex-box property controls what and what I need to do to align things the way I want. UILabs Layout compoenent are here to try and help. They don't do anything super fancy, but simply gives you a way to describe your user interface alignment in easier to remember terms.

Each Col, Row Or Center compoenents translates to a view and any prop you pass will be passed to this view. You can always override any style or add your own by passing in the style prop.

You can control the flex size property using the Size prop on both Row and Col components. In the example demo app you can find different demos that highlite different layouts you can create. And again - if there is something these componentd don't do, you can always combine them with regular Views and flex-box or override their style.

Examples

Horizontal alignment and sizing of columns

import * as React from 'react';
import { Text } from 'react-native';
import { Row, Alignment, Col } from '@farfarawaylabs/react-native-easy-flex';

export default function App() {
  // Horizontal alignment and sizing of columns
  return (
    <Row style={{ marginTop: 50 }}>
      <Col
        size={2}
        style={{ backgroundColor: '#FDB0C0' }}
        horizontalAlign={Alignment.End}
      >
        <Text>One</Text>
      </Col>
      <Col
        style={{ backgroundColor: '#ED0DD9' }}
        horizontalAlign={Alignment.Center}
      >
        <Text>Two</Text>
      </Col>
      <Col
        style={{ backgroundColor: '#FD4659' }}
        horizontalAlign={Alignment.Start}
      >
        <Text>Three</Text>
      </Col>
    </Row>
  );
}

Vertical alignment of columns

import * as React from 'react';
import { Text } from 'react-native';
import { Row, Alignment, Col } from '@farfarawaylabs/react-native-easy-flex';

export default function App() {
  // Vertical alignment of columns

  return (
    <Row style={{ marginTop: 50 }}>
      <Col
        style={{ backgroundColor: '#FDB0C0', height: 300 }}
        horizontalAlign={Alignment.End}
        verticalAlign={Alignment.Center}
      >
        <Text>One</Text>
      </Col>
      <Col
        style={{ backgroundColor: '#ED0DD9', height: 300 }}
        horizontalAlign={Alignment.Center}
        verticalAlign={Alignment.SpaceAround}
      >
        <Text>Two</Text>
        <Text>Another Two</Text>
        <Text>And another Two</Text>
      </Col>
      <Col
        style={{ backgroundColor: '#FD4659', height: 300 }}
        horizontalAlign={Alignment.Start}
        verticalAlign={Alignment.End}
      >
        <Text>Three</Text>
      </Col>
    </Row>
  );
}

Vertical alignment and sizing of rows

import * as React from 'react';
import { Text } from 'react-native';
import { Row, Alignment, Col } from '@farfarawaylabs/react-native-easy-flex';

export default function App() {
  // Vertical alignment and sizing of rows

  return (
    <Col style={{ marginTop: 50 }}>
      <Row
        style={{ backgroundColor: '#107AB0' }}
        size={2}
        verticalAlign={Alignment.Center}
      >
        <Text>One</Text>
      </Row>
      <Row style={{ backgroundColor: '#FDC1C5' }} verticalAlign={Alignment.End}>
        <Text>Two</Text>
      </Row>
      <Row
        style={{ backgroundColor: '#FD5956' }}
        verticalAlign={Alignment.Start}
      >
        <Text>Three</Text>
      </Row>
    </Col>
  );
}

Vertical alignment and sizing of Rows

import * as React from 'react';
import { Text } from 'react-native';
import { Row, Alignment, Col } from '@farfarawaylabs/react-native-easy-flex';

export default function App() {
  // Vertical alignment of columns

  return (
    <Col style={{ marginTop: 50 }}>
      <Row
        style={{ backgroundColor: '#107AB0', width: '100%' }}
        height={200}
        verticalAlign={Alignment.Center}
        horizontalAlign={Alignment.Center}
      >
        <Text>One</Text>
      </Row>
      <Row
        style={{ backgroundColor: '#FDC1C5', width: 300 }}
        verticalAlign={Alignment.End}
        horizontalAlign={Alignment.End}
        height={300}
      >
        <Text>Two</Text>
      </Row>
      <Row
        style={{ backgroundColor: '#FD5956', width: 300 }}
        verticalAlign={Alignment.Start}
        horizontalAlign={Alignment.SpaceBetween}
        height={100}
      >
        <Text>Three</Text>
        <Text>Three</Text>
        <Text>Three</Text>
      </Row>
    </Col>
  );
}

I just want to center stuff

import * as React from 'react';
import { Text } from 'react-native';
import { Row, Alignment, Col } from '} from '@farfarawaylabs/react-native-easy-flex';

export default function App() {
  // Simple centering

  return (
    <Center
      vertical
      horizontal
      style={{ width: '100%', height: '100%', backgroundColor: '#FDC1C5' }}
    >
      <Text>Dead center</Text>
    </Center>
  );
}

License

MIT