0.4.1 • Published 1 year ago

expo-split-pane v0.4.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

expo-split-pane

Split pane for Expo, movable divider.

Install

npm i expo-split-pane or yarn add expo-split-pane

Demo

open

Usage

export default function App() {
  return (
    <SafeAreaView style={{ flex: 1 }}>
      <SplitPane
        style={{ flex: 0.3 }}
        orientation="vertical"
        pane1={
          <View
            style={{ flex: 1, flexGrow: 1, backgroundColor: "deepskyblue" }}
          >
            <Text>top1</Text>
          </View>
        }
        pane2={
          <View style={{ flex: 1, flexGrow: 1, backgroundColor: "dodgerblue" }}>
            <Text>top2</Text>
          </View>
        }
      />
      <SplitPane
        style={{ flex: 1 }}
        orientation="horizontal"
        pane1={
          <View
            style={{ flex: 1, flexGrow: 1, backgroundColor: "lightyellow" }}
          >
            <Text>center1</Text>
          </View>
        }
        pane2={
          <View style={{ flex: 1, flexGrow: 1, backgroundColor: "khaki" }}>
            <Text>center2</Text>
          </View>
        }
      />
      <SplitPane
        style={{ flex: 0.3 }}
        orientation="vertical"
        pane1={
          <View style={{ flex: 1, flexGrow: 1, backgroundColor: "lightgreen" }}>
            <Text>bottom1</Text>
          </View>
        }
        pane2={
          <View style={{ flex: 1, flexGrow: 1, backgroundColor: "limegreen" }}>
            <Text>bottom2</Text>
          </View>
        }
      />
    </SafeAreaView>
  );
}

Props

proptyperequirednote
orientation'horizontal' or 'virtical'falsedefault is 'horizontal'
styleViewStylefalsecontainer style
dividerStyleViewStylefalsedivider style
pane1JSX.Elementtruefirst element
pane2JSX.Elementtruesecond element
pane1InitialSizeJSX.Elementtruefirst element initial size
pane2InitialSizeJSX.Elementtruesecond element initial size
minnumberfalsemin size, default is 30
flippedbooleanfalseflip pane1 and pane2
onChange(state) => voidfalsecallback of divider changed
0.4.1

1 year ago

0.4.0

1 year ago

0.3.1

1 year ago

0.3.0

1 year ago

0.2.7

1 year ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago