Code Monkey home page Code Monkey logo

react-native-togglebox's Introduction

react-native-togglebox

React Native Toggle Box for showing/hiding content with sliding effect. Should looks like classical slideToggle() from jQuery.

  • The ToggleBox scene should be wrapped in a ScrollView to allow the page to grow as the toggle opens
  • PRs welcome

Demo

Showtime

Installation

npm i react-native-togglebox --save

or

yarn add react-native-togglebox --save

Use

import ToggleBox from 'react-native-show-hide-toggle-box'

...

<ScrollView style={styles.container}>
  <ToggleBox label='Toggle this box' value='Tap Me' style={{backgroundColor: '#ddd', borderBottomWidth: 1}}>
    <View style={{height: 300, alignItems: 'center', justifyContent: 'center', backgroundColor: '#eee'}}>
      <Text>Hello, world!</Text>
    </View>
  </ToggleBox>
</ScrollView>

Props

Prop name Default prop Required Note
arrowColor rgb(178, 178, 178) - -
arrowSize 30 - -
arrowDownType 'keyboard-arrow-down' - Icon name fromreact-native-vector-icons/MaterialIcons
arrowUpType 'keyboard-arrow-up' - Icon name fromreact-native-vector-icons/MaterialIcons
children - Yes Element which you want to show inside of the box
expanded false - Boolean if box should be expanded or not
label - Yes Left label on the left of title
style {} - Custom styles
value null - Value on the right title

react-native-togglebox's People

Contributors

thepaulmcbride avatar

Stargazers

 avatar

Watchers

 avatar

react-native-togglebox's Issues

Changing of label color

Hi there,
how can I change the color of the label? Specifying color in the style prop doesn't work.
Thank you

[Android] Use togglebox with listview then app is crash

Hello,

we are using this along with listview pagination and app is crash.

I using below code

                                    <LazyloadListView
                                            style={(Platform == 'ios') ? { height: height - 100 } : { height: height - 100 }}
                                            contentContainerStyle={styles.themBackgroundColor}
                                            name="listExample"
                                            dataSource={self.state.dataSource}
                                            pageSize={5}
                                            initialListSize={30}
                                            scrollRenderAheadDistance={500}
                                            renderDistance={500}
                                            enableEmptySections={true}
                                            renderRow={(track, s, rowID) =>

                                                 <ToggleBox label={track.title} arrowSize={1} textStyle={styles.toggleText}>
                                                            <View style={ApplicationStyles.padding5}>
                                                                <Text style={ApplicationStyles.font14}>{track.artist}</Text>
                                                            </View>
                                                        </ToggleBox>
                                        </LazyloadListView>

Scroll list and then click on one list then toggle box open very slow and after 2-3 min app crash.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.