# @feizheng/react-details

> Details for react.

Latest version **1.0.3** (published 2020-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @feizheng/react-details
pnpm add @feizheng/react-details
yarn add @feizheng/react-details
bun add @feizheng/react-details
```

## 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 | 1.0.3 |
| Published | 2020-11-19 |
| First published | 2020-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 20.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | afei |
| Maintainers | afeiship |
| Keywords | react, component |

## Links

- npm: https://www.npmjs.com/package/@feizheng/react-details
- Repository: https://github.com/afeiship/react-details
- Homepage: https://github.com/afeiship/react-details#readme
- Issues: https://github.com/afeiship/react-details/issues
- npm.io page: https://npm.io/package/@feizheng/react-details

## Dependencies (3)

- [classnames](https://npm.io/package/classnames.md) ^2.2.6
- [object-assign](https://npm.io/package/object-assign.md) ^4.1.1
- [@feizheng/noop](https://npm.io/package/@feizheng/noop.md) ^1.0.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2020-11-19
- 1.0.1 — 2020-09-07
- 1.0.0 — 2020-09-07

## README

# react-details
> Details for react.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```shell
npm install -S @feizheng/react-details
```

## update
```shell
npm update @feizheng/react-details
```

## properties
| Name      | Type   | Required | Default | Description                           |
| --------- | ------ | -------- | ------- | ------------------------------------- |
| className | string | false    | -       | The extended className for component. |
| value     | bool   | false    | -       | The changed value.                    |
| onChange  | func   | false    | noop    | The change handler.                   |
| summary   | any    | false    | -       | The summary content.                  |


## usage
1. import css
  ```scss
  @import "~@feizheng/react-details/dist/style.scss";

  // customize your styles:
  $react-details-options: ()
  ```
2. import js
  ```js
  import NxOfflineSw from '@feizheng/next-offline-sw';
  import ReactGithubCorner from '@feizheng/react-github-corner';
  import ReactSwUpdateTips from '@feizheng/react-sw-update-tips';
  import React from 'react';
  import ReactDOM from 'react-dom';
  import ReactDetails from '@feizheng/react-details';
  import './assets/style.scss';

  class App extends React.Component {
    state = { hasUpdate: false, value: true };

    componentDidMount() {
      NxOfflineSw.install({
        onUpdateReady: () => {
          this.setState({ hasUpdate: true });
        }
      });
    }

    render() {
      return (
        <div className="p-3 app-container">
          <p className="p-3 bg-gray-200 mb-2">value: {this.state.value + ''}</p>
          <ReactDetails
            value={true}
            summary="道可道，非常道"
            onChange={(e) => {
              this.setState({ value: e.target.value });
            }}>
            道可道，非常道；名可名，非常名。 无名，天地之始，有名，万物之母。
            故常无欲，以观其妙，常有欲，以观其徼。
            此两者，同出而异名，同谓之玄，玄之又玄，众妙之门。
          </ReactDetails>
          <ReactSwUpdateTips value={this.state.hasUpdate} />
          <ReactGithubCorner value="https://github.com/afeiship/react-details" />
        </div>
      );
    }
  }

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

  ```

## animation
```css
/* remove arrow */
&::-webkit-details-marker {
  // display: none;
}


/* add animation */
&[open] summary ~ * {
  animation: open 0.5s ease-in-out;
}

@keyframes open {
  0% {
    opacity: 0;
    margin-left: -5px;
  }
  100% {
    opacity: 1;
    margin-left: 0px;
  }
}
```

## documentation
- https://afeiship.github.io/react-details/


## license
Code released under [the MIT license](https://github.com/afeiship/react-details/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@feizheng/react-details
[version-url]: https://npmjs.org/package/@feizheng/react-details

[license-image]: https://img.shields.io/npm/l/@feizheng/react-details
[license-url]: https://github.com/afeiship/react-details/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@feizheng/react-details
[size-url]: https://github.com/afeiship/react-details/blob/master/dist/react-details.min.js

[download-image]: https://img.shields.io/npm/dm/@feizheng/react-details
[download-url]: https://www.npmjs.com/package/@feizheng/react-details

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