GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - native-ly/native-layout-stack: ↘️ SwiftUI like layout management for React Native

BranchesTags
Open more actions menu

Latest commit

 

History

55 Commits
55 Commits

Folders and files

NameName
Last commit message
Last commit date
.husky
.husky
 
 
__tests__
__tests__
 
 
src
src
 
 
.eslintrc.js
.eslintrc.js
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
.prettierrc
.prettierrc
 
 
.travis.yml
.travis.yml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
babel.config.js
babel.config.js
 
 
jest.config.js
jest.config.js
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

native-layout-stack

NPM version NPM downloads NPM license run in expo snack Codecov Travis

About

SwiftUI like layout management for React Native

Idea

This library recreates SwiftUI components in React Native:

Stack

  • HStack
  • VStack

Spacer

  • Spacer

Alternatives

  • Stacks by Marcin Dziewulski
  • react-native-divisible-view by kangsu
  • React Native Spacing System by Hirokazu Nakano Tei
  • react-native-stacks by Andrew Levy

How to Install

First, install the library in your project by npm:

$ npm install native-layout-stack

Or Yarn:

$ yarn add native-layout-stack

Getting Started

• Connect library with project using ES6 import:

import { LayoutProvider, Stack, Spacer } from 'native-layout-stack'

Options

LayoutProvider

name type description
padding Space or [Space] or [Space, Space] or [Space, Space, Space] or [Space, Space, Space, Space] Outer space
spaces Space Space between children
omitNull boolean Skip elements that are null or React.Fragment
arrayDivision boolean
debug boolean Add random color to spaces

Stack

Stack extends ViewProps and implements all LayoutProvider props without debug

Spacer

Component uses ViewProps

Types

name type
Space number or string

Example

import React from 'react'
import { View } from 'react-native'
import { LayoutProvider, Stack, Spacer } from 'native-layout-stack'

const MyComponent = () => {
  return (
    <Stack padding={[20, 10]} spaces={20}>
      <View />
      <View />
      <View />
    </Stack>
  )
}

const App = () => {
  return (
    <LayoutProvider spaces={10} padding={20}>
      <MyComponent />
    </LayoutProvider>
  )
}

export default App

License

This project is licensed under the MIT License © 2020-present Jakub Biesiada

About

↘️ SwiftUI like layout management for React Native

snack.expo.io/@jbiesiada/native-layout-stack

Topics

androidexpogridhorizontalioslayoutlibrarymobilereactreact-nativespacerstackswiftuiverticalweb

Resources

Readme
MIT license
Activity
Custom properties

Stars

10 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.