Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
react-viewmore
Advanced tools
A component that automatically hides content when its height is greater than the browser's height.
#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 hidesonShow
(Function) : A callback called when the content is shownonReadmore
: (Function) : A callback called when the view more
button is clickedonReadless
: (Function) : A callback called when the view less
button is clickedtype
(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
FAQs
A component that automatically hides content when its height is greater than the browser's height.
The npm package react-viewmore receives a total of 4 weekly downloads. As such, react-viewmore popularity was classified as not popular.
We found that react-viewmore demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.