GithubHelp home page GithubHelp logo

arncet / react-viewmore Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 822 KB

A component that automatically hides content when its height is greater than the browser's height.

License: MIT License

JavaScript 100.00%
readmore react

react-viewmore's Introduction

#react-viewmore

A component to hide automatically content when its height is larger than browser's height.

##Navigation :

##How to use :

Install react-viewmore via npm :

npm install --save react-viewmore

Use it :

import Readmore from 'react-viewmore'

<Readmore id='viewmore-example'>
	<h1>Random title</h1>
	<p>...</p>
</Readmore>

##Properties :

  • id (Number || String) : An unique id for the Readmore component (default: random integer)
  • readMoreText (String) : The button text when the content is hidden (default: 'View more')
  • readLessText (String) : The button text when the content is fully displayed (default: 'View less')
  • wrapperClassName (String) : An additionnal className from the wrapper (default: 'Read_more')
  • hideClasse (String) : An additionnal className when the content is hiden (default: 'Read_more_hide')
  • buttonClassName (String) : An additionnal className for the button (default: 'Read_more_button')
  • offset (Number) : An additionnal height to max value to hide the children contnet (default: 0)
  • onHide (Function) : A callback called when the content is hides
  • onShow (Function) : A callback called when the content is shown
  • onReadmore: (Function) : A callback called when the view more button is clicked
  • onReadless: (Function) : A callback called when the view less button is clicked
  • type (String || Component) : A custom HTML tag or a component to replace the default view more button.
  • maxHeight (String) : A max height to hide the content.

##Development :

npm install 		  //Install node modules
npm run storybook //Launch the project

npm lint    		 //Run linter

##License :

MIT

react-viewmore's People

Contributors

arncet avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.