1.0.6 • Published 5 years ago

react-native-columns v1.0.6

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

version license PRs Welcome

react-native-columns

User resizable columns component for react native

npm.io

Installation

yarn add react-native-columns

OR (npm install does not work consistently)

npm i -S react-native-columns

Example

import React from 'react'
import {
  Text,
  View
} from 'react-native'
import SomeComponent from './SomeComponent'
import Columns from 'react-native-columns'

export default class Main extends React.Component {
  leftCol = (
    <View>
      <Text>
        This is the left column
      </Text>
    </View>
  )

  render() {
    return (
      <Columns
        initialLeft={ 0.4 }
        max={ 85 }
        min={ 15 }
        leftCol={ this.leftCol }
        rightCol={ <SomeComponent /> }
      />
    )
  }
}

Props

propertydefaulttypedescription
min20number x/100left column minimum % of screen width
max75number x/100left column maximum % of screen width
initialLeft0.35decimal between 0 and 1initial left col width x/1
leftColLeft Columnreact componentreact component
rightColRight Columnreact componentreact component

currently only supports full screen width. PR's welcome (to develop branch please)

supports iOS and Android