JSPM

rn-expandable-text

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 21
  • Score
    100M100P100Q59812F
  • License ISC

Expandable Text component of React Native, collapse text when the content exceeds specified number of lines

Package Exports

  • rn-expandable-text

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rn-expandable-text) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

RN-ExpandableText

NPM Version License

Introduction

RN-ExpandableText is an component of React Native, all the usages of ExpandableText is the same as the native Text component, but it will collapse text when its content exceeds specified number of lines.

Installation

npm install rn-expandable-text --save

ExpandableText Usage

    import ExpandableText from 'rn-expandable-text'
    
    <ExpandableText
      numberOfLines={10}
      style={styles.expandableText}
      unexpandView={() => null}
      expandView={() =>
        (<View style={styles.arrow} />)
      }
    >
      {content}
    </ExpandableText>

Properties

Prop Description Default
numberOfLines The max number of lines the content will be, the content exceed this value, the expandview will show. 5
expandView A callback function to return expand-view, you can customize the expand-view. when it's null, expand-view will disappear
unexpandView A callback function to return unexpand-view. Usage the same as expandView
onExpand A callback when the content expands -
onCollapse A callback when the content collapses -

Demos

Default View customize the expand-view
Default View Default View

Follow Me

Follow me on Wechat