https://github.com/afeiship/react-collapse
Collapse for react.
https://github.com/afeiship/react-collapse
collapse collapsible details react toggle
Last synced: 4 months ago
JSON representation
Collapse for react.
- Host: GitHub
- URL: https://github.com/afeiship/react-collapse
- Owner: afeiship
- Created: 2020-09-10T02:14:03.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-09-16T07:50:24.000Z (almost 2 years ago)
- Last Synced: 2025-09-14T06:58:58.909Z (10 months ago)
- Topics: collapse, collapsible, details, react, toggle
- Language: TypeScript
- Homepage: https://afeiship.github.io/react-collapse/
- Size: 285 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-collapse
> Collapse 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 @jswork/react-collapse
```
## usage
1. import css
```scss
@import "~@jswork/react-collapse/dist/style.css";
// or use sass
@import "~@jswork/react-collapse/dist/style.scss";
```
2. import js
```js
import ReactCollapse from '@jswork/react-collapse';
import './index.css';
import '@jswork/react-collapse/dist/style.scss';
import { useEffect, useState } from 'react';
function App() {
const [val, setVal] = useState(false);
useEffect(() => {
setTimeout(() => {
setVal(true);
}, 3000);
}, []);
return (
Build Time: {BUILD_TIME}
react-collapse
setVal(!val)}>Toggle - {String(val)}
console.log('value: ', e)}
>
);
}
export default App;
```
## preview
- https://afeiship.github.io/react-collapse/
## license
Code released under [the MIT license](https://github.com/afeiship/react-collapse/blob/master/LICENSE.txt).
[version-image]: https://img.shields.io/npm/v/@jswork/react-collapse
[version-url]: https://npmjs.org/package/@jswork/react-collapse
[license-image]: https://img.shields.io/npm/l/@jswork/react-collapse
[license-url]: https://github.com/afeiship/react-collapse/blob/master/LICENSE.txt
[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/react-collapse
[size-url]: https://github.com/afeiship/react-collapse/blob/master/dist/react-collapse.min.js
[download-image]: https://img.shields.io/npm/dm/@jswork/react-collapse
[download-url]: https://www.npmjs.com/package/@jswork/react-collapse