Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
react-accordion-component
Advanced tools
#React Accordion Component
#Installation
$ npm install react-accordion-component
#Usage
To get the basic style of the component, link in your index.html
the CSS file for the Accordion:
<link rel="stylesheet" href=/path/to/accordion.css>
(normally located under your node_modules
directory)
After that just require the component in the desired place of use:
var Accordion = require('react-accordion-component');
The Accordion
accepts an array of objects, where each of them may have:
title
: title for an accordion element (string
)onClick
: callback function triggered when an accordion element is clicked (function
)content
: content for an accordion element (string
)###Example
var elements = [];
elements.push({
title: 'Element 1',
onClick: function() {
alert('Hello World!')
},
content: 'Lorem Ipsum...'
});
elements.push({
title: 'Element 2',
onClick: function() {
},
content: 'Lorem Ipsum...'
});
When rendering (using jsx
):
React.render(<Accordion elements={elements} />, document.getElementById('accordion-example'));
###Voilà
Click in the fish eye to exapand/collapse each accordion element.
#Notes
In the index.html
under examples/
I've used Source Sans Pro font from Google Fonts. Feel free to change the font in accordion.css
to your preferred font.
#TODO
title
property to the accordion(e.g. <Accordion elements={elements} title={title} />
#License MIT
FAQs
Minimal UI Accordion component written in React
The npm package react-accordion-component receives a total of 20 weekly downloads. As such, react-accordion-component popularity was classified as not popular.
We found that react-accordion-component 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.