0.0.1 • Published 7 years ago

react-native-text-collapse v0.0.1

Weekly downloads
16
License
MIT
Repository
github
Last release
7 years ago

react-native-text-collapse

react-native-text-collapse is a light animated React Native Instagram clone text collapser.

npm.io

Installation

Install react-native-text-collapse using the following command:

npm install react-native-text-collapse --save

Usage

All you need to do is to import Native-Dates into your react native component and easily use it. Example:

import React, {Component} from 'react';  
import {View, StyleSheet} from "react-native";  
import TextCollapse from 'react-native-text-collapse';  
  
export default class App extends Component {
    render() {  
        return (
            <View style={styles.main}>
                <TextCollapse text={"Hi There!"}/>
            </View>
        );
    }  
}  
  
const styles = StyleSheet.create({  
    main: {  
	    flex:1,  
	    width: '100%',  
	    height: '100%',  
	}  
})

Props

Props nameDesciptionValuesDefault value
textThe text you want to collapse(String)'Lorem Ipsum...'
initialTextLengthNumber of characters that is show in collapsed mode(Number)70
containerStyleThe text container style(Style Object)null
textStyleThe text style(Style Object)null
showMoreTextStyle'more' and 'less' words style(Style Object){color: '#858585',paddingStart: 5}
collapseDurationDuration of collapse(Number)250
collapseTypeAnimation type of collapse'spring','easeInEaseOut','linear''spring'
springDampingDamping amount when collapse type is 'spring'(Number)0.7
0.0.1

7 years ago