# @lion/collapsible

> This component is a combination of a button (the invoker), a chunk of extra content.

Latest version **0.9.1** (published 2022-09-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @lion/collapsible
pnpm add @lion/collapsible
yarn add @lion/collapsible
bun add @lion/collapsible
```

## Health

**Score 45/100 (D)** — status: abandoned.

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

Warnings: low downloads; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.9.1 |
| Published | 2022-09-08 |
| First published | 2020-07-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 27.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1970 |
| Author | ing-bank |
| Maintainers | narzac, d4kmor |
| Keywords | collapsible, expandable, lion, web-components |

## Links

- npm: https://www.npmjs.com/package/@lion/collapsible
- Repository: https://github.com/ing-bank/lion
- Homepage: https://github.com/ing-bank/lion/
- Issues: https://github.com/ing-bank/lion/issues
- npm.io page: https://npm.io/package/@lion/collapsible

## Dependencies (1)

- [@lion/core](https://npm.io/package/@lion/core.md) ^0.24.0

## Recent versions

- 0.9.1 (latest) — 2022-09-08
- 0.5.4 (lit1) — 2023-04-13
- 0.9.0 — 2022-05-31
- 0.5.3 — 2022-05-16
- 0.5.2 — 2022-05-09
- 0.5.1 — 2022-05-09
- 0.8.0 — 2022-04-06
- 0.7.0 — 2022-03-07
- 0.6.6 — 2022-01-04
- 0.6.5 — 2021-11-11
- 0.6.4 — 2021-10-19
- 0.6.3 — 2021-09-01
- 0.6.2 — 2021-07-21
- 0.6.1 — 2021-07-05
- 0.6.0 — 2021-05-31
- … 24 more at https://npm.io/package/@lion/collapsible/versions

## README

# Collapsible >> Overview ||10

A combination of a button (the invoker) and a chunk of 'extra content'. This web component can be extended with an animation to disclose the extra content. There are two slots available respectively; `invoker` to specify the collapsible's invoker and `content` for the extra content of the collapsible.

```js script
import { html } from '@mdjs/mdjs-preview';
import '@lion/collapsible/define';
```

```js preview-story
export const main = () => html`
  <lion-collapsible>
    <button slot="invoker">More about cars</button>
    <div slot="content">
      Most definitions of cars say that they run primarily on roads, seat one to eight people, have
      four tires, and mainly transport people rather than goods.
    </div>
  </lion-collapsible>
`;
```

## Features

- Use `opened` attribute or `toggle()` method to render default open.
- `invoker` slot can be custom template e.g. our [button](https://github.com/ing-bank/lion/blob/650657231a4ec83592d45cd69836d28436635340/docs/components/button/overview.md) or native `button` with custom styling.
- Observe the state with the help of `@opened-changed` event.
- `show()` and `hide()` are helper methods to hide or show the content from outside.

## Installation

```bash
npm i --save @lion/collapsible
```

```js
import { LionCollapsible } from '@lion/collapsible';
// or
import '@lion/collapsible/define';
```

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