Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/itemconsulting/details-animated

Custom component that animates <details><summary>
https://github.com/itemconsulting/details-animated

Last synced: 2 months ago
JSON representation

Custom component that animates <details><summary>

Awesome Lists containing this project

README

        

# Custom component for animating details/summary elements

[![npm version](https://badge.fury.io/js/@itemconsulting%2Fdetails-animated.svg)](https://badge.fury.io/js/@itemconsulting%2Fdetails-animated)

## Usage

Register the custom element with JavaScript.

```javascript
import DetailsAnimated from "@itemconsulting/details-animated";

if (!window.customElements.get("details-animated")) {
window.customElements.define("details-animated", DetailsAnimated);
}
```

Use the custom element to wrap a ``/`

Open this nice animated disclosure

This part here will animate in nicely!

```

## Statechart

The component is driven by a statemachine following this diagram:

```mermaid
stateDiagram-v2
[*] --> closed
closed --> opening: click
opening --> open: done
opening --> closing: click
closing --> closed: done
closing --> opening: click
open --> closing: click

```