1.1.1 • Published 2 years ago

@duonghaidang/react-native-text-more v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@duonghaidang/react-native-text-more

Installation

npm i @duonghaidang/react-native-text-more --save

or with yarn

yarn add @duonghaidang/react-native-text-more

Usage

import React from "react";
import { StyleSheet, View } from "react-native";
import TextMore from "@duonghaidang/react-native-text-more";

const Home = () => {
  return (
    <View style={styles.container}>
      <TextMore style={styles.text} numberOfLines={5}>
        Lorem Ipsum is simply dummy text of the printing and typesetting
        industry. Lorem Ipsum has been the industry's standard dummy text ever
        since the 1500s, when an unknown printer took a galley of type and
        scrambled it to make a type specimen book. It has survived not only five
        centuries, but also the leap into electronic typesetting, remaining
        essentially unchanged. It was popularised in the 1960s with the release
        of Letraset sheets containing Lorem Ipsum passages, and more recently
        with desktop publishing software like Aldus PageMaker including versions
        of Lorem Ipsum.
      </TextMore>
    </View>
  );
};

export default Home;

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: "center",
  },
  text: {
    fontSize: 16,
  },
});

Props

PropTypeRequiredNote
titleMorestringnostring that will replace the See more label
titleLessstringnostring that will replace the See less label
childrenstringyesstring to render on See more component
renderMorefunctionnofunction that will replace the See more label
renderLessfunctionnofunction that will replace the See less label
styleTextMoreobject or arraynotext style for See more label
styleTextLessobject or arraynotext style for See less label