react-text-collapse
React text collapse expand tool
Last updated 10 months ago by cht8687 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install react-text-collapse 
SYNC missed versions from official npm registry.

React text collapse

NPM Version Coverage Status Build Status Downloads Dependency Status License

React text collapse

Philosophy

Keep things simple! You don't need jQuery...

Installation

Join the chat at https://gitter.im/cht8687/react-text-collapse

npm

$ npm install --save react-text-collapse

Demo

Demo

Example code

Code Example

Usage

<ReactTextCollapse options={TEXT_COLLAPSE_OPTIONS}>
  <p>
    React text collapse is awesome. React text collapse is awesome.<br />
    React text collapse is awesome. React text collapse is awesome.<br />
    React text collapse is awesome. React text collapse is awesome.<br />
    React text collapse is awesome. React text collapse is awesome.<br />
  </p>
</ReactTextCollapse>

Options

options: PropTypes.object.isRequired

const TEXT_COLLAPSE_OPTIONS = {
  collapse: false, // default state when component rendered
  collapseText: '... show more', // text to show when collapsed
  expandText: 'show less', // text to show when expanded
  minHeight: 100, // component height when closed
  maxHeight: 250 // expanded to
  textStyle: { // pass the css for the collapseText and expandText here
    color: "blue",
    fontSize: "20px"
  }
}

Development

$ git clone git@github.com:cht8687/react-text-collapse.git
$ cd react-text-collapse
$ npm install
$ webpack-dev-server

Then

open http://localhost:8080/webpack-dev-server/

License

MIT

js-standard-style

Current Tags

  • 0.5.2                                ...           latest (10 months ago)

16 Versions

  • 0.5.2                                ...           10 months ago
  • 0.5.0                                ...           a year ago
  • 0.4.4                                ...           a year ago
  • 0.4.3                                ...           2 years ago
  • 0.4.2                                ...           2 years ago
  • 0.4.1                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
  • 0.2.0                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
  • 0.0.5                                ...           3 years ago
  • 0.0.4                                ...           3 years ago
  • 0.0.3                                ...           3 years ago
  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
  • 0.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 25
Dependencies (1)
Dev Dependencies (27)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |