Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

accordie

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

accordie

Custom React Accordion Component

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
0
Created
Source

Accordie

npm license

Custom React Accordion Component

Demo

Installation

Install with Yarn

$ yarn add accordie

or NPM

$ npm i accordie

Usage

import React from 'react'
import ReactDOM from 'react-dom'
import { Accordie, Panel } from 'accordie'

const App = () => {
  return (
    <Accordie>
      <Panel
        Heading={<div>Heading 1</div>}
        Content={<div>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</div>}
      />

      <Panel
        Heading={<div>Heading 2</div>}
        Content={<div>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</div>}
      />
    </Accordie>
  )
}

ReactDOM.render(<App />, document.getElementById('root'))

Props

<Accordie>

If customStyle is true classNames overrides all the actual classes.

<Accordie
  customStyle
  classNames={{
    panel: 'panel',
    heading: 'heading',
    content: 'content',
    open: 'open',
    close: 'close'
  }}
>

<Panel>

Heading and Content props could be a String or a React Component.

<Panel
  Heading='Heading'
  Content={<div>Content</div>}
/>

Contribution

Feel free to contribute. Open a new issue, or make a pull request.

License

MIT

Keywords

react

FAQs

Package last updated on 16 Nov 2024

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