Security News
vlt Debuts New JavaScript Package Manager and Serverless Registry at NodeConf EU
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
react-sanfona
Advanced tools
React accordion component
Install via NPM:
npm install react-sanfona
Then:
import { Accordion, AccordionItem } from 'react-sanfona';
…
render() {
return (
<Accordion>
{[1, 2, 3, 4, 5].map(item => {
return (
<AccordionItem title={`Item ${item}`} expanded={item === 1}>
<div>
{`Item ${item} content`}
</div>
</AccordionItem>
);
})}
</Accordion>
);
}
…
Property | Type | Description | Default |
---|---|---|---|
allowMultiple | Boolean | Allow multiple items to be open at the same time. | false |
isHovered | Boolean | Allow expanding an element after the mouse hovers an item. | false |
openNextAccordionItem | Boolean | Opens the next accordion item after the previous one is closed. Defaults first one as active and applies for each accordion item except the last one. | false |
className | String | Custom classname applied to root element | null |
style | Object | Inline styles applied to root element | null |
onChange | Function | Triggered when component updates and passes new state as an argument | null |
rootTag | String | Custom HTML tag used for root element | 'div' |
duration | Number | Open/close transition duration in milliseconds | 300 |
easing | String | Open/close transition easing | 'ease' |
Property | Type | Description | Default |
---|---|---|---|
title | String / Object | Text or Object to display in header. | null |
expanded | Boolean | If item body should be expanded or not | false |
onExpand | Function | Callback for when item is expanded | null |
onClose | Function | Callback for when item closes | null |
className | String | Custom classname applied to root item element | null |
bodyClassName | String | Custom classname applied to the accordion item body | null |
expandedClassName | String | Custom classname applied when accordion is expanded | null |
titleClassName | String | Custom classname applied to accordion item header text | null |
disabled | Boolean | If item should be disabled or not | false |
disabledClassName | String | Custom classname applied to accordion item header text when item is disabled | null |
rootTag | String | Custom HTML tag used for root element | 'div' |
titleTag | String | Custom HTML tag used for title element | 'h3' |
bodyTag | String | Custom HTML tag used for body element | 'div' |
duration | Number | Open/close transition duration in milliseconds | 300 |
easing | String | Open/close transition easing | 'ease' |
Classname | Targets |
---|---|
react-sanfona | Accordion container |
react-sanfona-item | AccordionItem container |
react-sanfona-item-expanded | AccordionItem container when expanded |
react-sanfona-item-title | AccordionItem header text |
react-sanfona-item-body | AccordionItem body container |
react-sanfona-item-body-wrapper | AccordionItem body children wrapper |
react-sanfona-item-disabled | AccordionItem is disabled |
npm install
npm start // served on localhost:8080
npm test
FAQs
React accessible accordion component
The npm package react-sanfona receives a total of 418 weekly downloads. As such, react-sanfona popularity was classified as not popular.
We found that react-sanfona 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
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
Security News
Research
The Socket Research Team uncovered a malicious Python package typosquatting the popular 'fabric' SSH library, silently exfiltrating AWS credentials from unsuspecting developers.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.