# @phemium-costaisa/accordion

> Accordion web component built with Stencil One.

Latest version **1.0.3** (published 2022-07-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @phemium-costaisa/accordion
pnpm add @phemium-costaisa/accordion
yarn add @phemium-costaisa/accordion
bun add @phemium-costaisa/accordion
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2022-07-29 |
| First published | 2022-06-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 3.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | phemiumcostaisa |
| Keywords | accordion, expansion, panel, web, component |

## Links

- npm: https://www.npmjs.com/package/@phemium-costaisa/accordion
- Repository: https://github.com/edmbn/accordion
- Homepage: https://github.com/edmbn/accordion/#readme
- Issues: https://github.com/edmbn/accordion/issues
- npm.io page: https://npm.io/package/@phemium-costaisa/accordion

## Dependencies (3)

- [@types/node](https://npm.io/package/@types/node.md) ^12.0.8
- [tailwindcss](https://npm.io/package/tailwindcss.md) ^1.0.4
- [postcss-import](https://npm.io/package/postcss-import.md) ^12.0.1

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2022-07-29
- 1.0.3-SNAPSHOT.3 — 2022-07-29
- 1.0.3-SNAPSHOT.2 — 2022-07-29
- 1.0.3-SNAPSHOT.1 — 2022-07-29
- 1.0.2 — 2022-06-20

## README

# Accordion Web Component

## Installation

```bash
 npm i @phemium-costaisa/accordion
```

## Usage

In your HTML files:

```
 <edmbn-accordion header-title="Title" expanded bordered>
    <div slot="content">
        <ul>
            <li>Item 1</li>
            <li>Item 2</li>
            <li>Item 3</li>
        </ul>
    </div>
 </edmbn-accordion>
```

Include attribute **slot="content"** to all the content that you want to be inside the accordion.

### Javascript or AngularJS (1.x)

```
<script src="./plugins/edmbn-accordion.js"></script>
```

### Angular 2+

Somewhere in your project (e.g. `main.ts`):

```
import { defineCustomElements as accordionLoader } from 'edmbn-accordion/loader';
accordionLoader(window);
```

### React

On your index.js:

```
import { defineCustomElements as accordionLoader } from 'edmbn-accordion/loader';
accordionLoader(window);
```

### Vue

```
import { defineCustomElements as accordionLoader } from 'edmbn-accordion/loader';
Vue.config.ignoredElements = [/test-\w*/];
accordionLoader(window);
```

## Properties

|      Property      | Default |                   Description                   |
| :----------------: | :-----: | :---------------------------------------------: |
|   `header-title`   |         |         Set the accordion header title.         |
|     `expanded`     | `false` |            Set the default position.            |
|     `bordered`     | `false` | Set border top and bottom by default on header. |
| `lost-focus-close` | `false` | Whether to close accordion when loosing focus.  |
| `observe-content`  | `false` |      Set to true when content is dynamic.       |
|      `debug`       | `false` |         Set to true for debugging logs.         |

## Slots

| Name      | Description                                           |
| --------- | ----------------------------------------------------- |
| `content` | `HTML Content to put inside accordion when unfolded`  |
| `right`   | `HTML Content to put in the right part of the header` |

## Customize CSS

|          Variable           |                           Default                           |
| :-------------------------: | :---------------------------------------------------------: |
|      `--header-height`      |                            50px                             |
| `--header-background-color` |                            white                            |
|   `--header-button-color`   |                            black                            |
|   `--header-button-width`   |                           1.5rem                            |
|    `--header-text-color`    |                            black                            |
|   `--header-font-weight`    |                             700                             |
|    `--header-font-size`     |                            1rem                             |
|    `--header-border-top`    | var(--border-width) var(--border-style) var(--border-color) |
|  `--header-border-bottom`   | var(--border-width) var(--border-style) var(--border-color) |
|   `--header-border-left`    |                            none                             |
|   `--header-border-right`   |                            none                             |
|      `--border-style`       |                            solid                            |
|      `--border-width`       |                             1px                             |
|      `--border-color`       |                            #ccc                             |

## Contribute

```bash
git clone https://github.com/phemium/accordion.git
cd accordion
```

and run:

```bash
npm install
npm start
```

To build the component for production, run:

```bash
npm run build
```

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