# simple-accordion

> A Simple React Accordion

Latest version **2.1.0** (published 2019-02-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-accordion
pnpm add simple-accordion
yarn add simple-accordion
bun add simple-accordion
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2019-02-01 |
| First published | 2019-01-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 2.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | joeburton |

## Links

- npm: https://www.npmjs.com/package/simple-accordion
- npm.io page: https://npm.io/package/simple-accordion

## Dependencies (3)

- [react](https://npm.io/package/react.md) ^16.0.0
- [react-dom](https://npm.io/package/react-dom.md) ^16.0.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.6.0

## Recent versions

- 2.1.0 (latest) — 2019-02-01
- 2.0.0 — 2019-01-30
- 1.9.0 — 2019-01-30
- 1.8.8 — 2019-01-24
- 1.8.7 — 2019-01-24
- 1.8.6 — 2019-01-24
- 1.8.5 — 2019-01-24
- 1.8.3 — 2019-01-24
- 1.8.1 — 2019-01-24
- 1.8.0 — 2019-01-23
- 1.6.0 — 2019-01-23
- 1.5.0 — 2019-01-23
- 1.4.0 — 2019-01-23
- 1.3.0 — 2019-01-23
- 1.2.0 — 2019-01-23
- … 2 more at https://npm.io/package/simple-accordion/versions

## README

## Simple Accordion Component (React)

### Installation

Add the below to your package.json file

`"simple-accordion": "git+https://github.build.ge.com/smallworld/simple-accordion.git#master"`

### How To Use

First import the component where you want to use it

`import Accordion from "simple-accordion";`

Then just render it

```
<Accodion item={{
  header: "Simple Accordion Header",
  content:"Simple Accordion Content."
}} />
```

### Props

| _Prop_ |                    _Description_                     | _Default value_ |
| ------ | :--------------------------------------------------: | :-------------: |
| item   | Object containing two key values, header and content |    Object {}    |

### Example

```
import React, { Component } from "react";
import Accodion from "simple-accordion";

class App extends Component {
  render() {
    return (
        <Accodion item={{
          header: "Simple Accordion Header",
          content:"Simple Accordion Content."
        }} />
    );
  }
}

export default App;
```

### CSS variables - the component exposes three custom variables

--simple-accordion-container

--simple-accordion-header

--simple-accordion-content

### To make stye changes add the following block to an HTML header
### Alternatively target the DOM elements

```
<style>
  body {
    --simple-accordion-header: #e2e8ed;
    --simple-accordion-content: #eaeef1;
    --simple-accordion-container: #eaeef1;
  }
</style>
```

---

### How to modify the component

First install all dependencies

Run command from root ./

`$ npm ci`

Edit files in ./src/

- index.js
- accordion.css

---

### Update published component files

Run command from root ./

`$ npm run build`
 
---

### Run demo

Open index.html in ./demo/

---

### Update the demo files

First install all dependencies

Run command from ./demo/

`$ npm ci`

Edit file in ./demo/src/

- index.js

---

### Update demo dist files

`$ npm run build`


### Run tests

`$ npm run test`

Note: if you update the component update the tests

---
_Source: https://npm.io/package/simple-accordion · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
