https://github.com/zmitry/react-collaps
1KB React component for collapsing content with animation. Useful for building accordions
https://github.com/zmitry/react-collaps
react
Last synced: about 2 months ago
JSON representation
1KB React component for collapsing content with animation. Useful for building accordions
- Host: GitHub
- URL: https://github.com/zmitry/react-collaps
- Owner: zmitry
- Created: 2020-12-18T19:04:30.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-22T20:19:33.000Z (about 5 years ago)
- Last Synced: 2025-03-06T06:36:30.995Z (over 1 year ago)
- Topics: react
- Language: TypeScript
- Homepage: https://react-collaps.vercel.app
- Size: 39.1 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
## React-collaps
React component for collapsing and expanding state.
Useable for developing component like accordions and similar stuff.
[demo preview](https://react-collaps.vercel.app/)
## How to use
```jsx
function Section({ children, title, id }) {
const [state, setState] = useState(false);
return (
{
setState((v) => !v);
}}
>
{title}
{children}
);
});
```