Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-sanfona

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-sanfona

React accessible accordion component

  • 1.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
510
decreased by-44.81%
Maintainers
1
Weekly downloads
 
Created
Source

react-sanfona

NPM info

Travis build status Depfu

React accordion component

giphy 1

Usage

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>
    );
  }

…

options / PropTypes

Accordion
PropertyTypeDescriptionDefault
allowMultipleBooleanAllow multiple items to be open at the same time.false
isHoveredBooleanAllow expanding an element after the mouse hovers an item.false
openNextAccordionItemBooleanOpens 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
classNameStringCustom classname applied to root elementnull
styleObjectInline styles applied to root elementnull
onChangeFunctionTriggered when component updates and passes new state as an argumentnull
rootTagStringCustom HTML tag used for root element'div'
durationNumberOpen/close transition duration in milliseconds300
easingStringOpen/close transition easing'ease'
AccordionItem
PropertyTypeDescriptionDefault
titleString/ ObjectText or Object to display in header.null
expandedBooleanIf item body should be expanded or notfalse
onExpandFunctionCallback for when item is expandednull
onCloseFunctionCallback for when item closesnull
classNameStringCustom classname applied to root item elementnull
bodyClassNameStringCustom classname applied to the accordion item bodynull
expandedClassNameStringCustom classname applied when accordion is expandednull
titleClassNameStringCustom classname applied to accordion item header textnull
disabledBooleanIf item should be disabled or notfalse
disabledClassNameStringCustom classname applied to accordion item header text when item is disablednull
rootTagStringCustom HTML tag used for root element'div'
titleTagStringCustom HTML tag used for title element'h3'
bodyTagStringCustom HTML tag used for body element'div'
durationNumberOpen/close transition duration in milliseconds300
easingStringOpen/close transition easing'ease'

Styling with classnames

ClassnameTargets
react-sanfonaAccordion container
react-sanfona-itemAccordionItem container
react-sanfona-item-expandedAccordionItem container when expanded
react-sanfona-item-titleAccordionItem header text
react-sanfona-item-bodyAccordionItem body container
react-sanfona-item-body-wrapperAccordionItem body children wrapper
react-sanfona-item-disabledAccordionItem is disabled

development

npm install

npm start // served on localhost:8080

npm test

Keywords

FAQs

Package last updated on 18 Jan 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc