
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
@idui/react-collapse
Advanced tools
npm install --save @idui/react-collapse
yarn add @idui/react-collapse
import React from 'react'
import Collapse from '@idui/react-collapse'
function Example() {
return <Collapse>
<Collapse.Header>Open</Collapse.Header>
<Collapse.Body>:)</Collapse.Body>
</Collapse>
}
import React, { Fragment } from 'react'
import Collapse from '@idui/react-collapse'
function Example() {
return <Collapse>
<Header>
{({ open, close, toggle }) => (
<Fragment>
<button onClick={open}>Open</button>
<button onClick={close}>Close</button>
<button onClick={toggle}>Toggle</button>
</Fragment>
)}
</Header>
<Collapse.Body>:)</Collapse.Body>
</Collapse>
}
import React from 'react'
import Collapse from '@idui/react-collapse'
function Example() {
return <Collapse>
<Collapse.Header>Open</Collapse.Header>
<Collapse.Body>
{({ close }) => (
<Button onClick={close}>Close</Button>
)}
</Collapse.Body>
</Collapse>
}
import React from 'react'
import styled from 'styled-components';
import Collapse from '@idui/react-collapse'
const Header = styled(Collapse.Header)`
padding: 10px;
line-height: 20px;
cursor: pointer;
box-shadow: rgba(0, 0, 0, 0.35) 0 5px 15px;
width: 100%;
`;
const Body = styled(Collapse.Body)`
box-shadow: rgba(0, 0, 0, 0.35) 0 5px 15px;
padding: 20px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
width: 100%;
`;
const Content = styled.div`
height: 200px;
display: flex;
align-items: center;
justify-content: center;
`;
function Example() {
return <Collapse>
<Header>Open</Header>
<Body>
<Content>:)</Content>
</Body>
</Collapse>
}
import React from 'react'
import Collapse from '@idui/react-collapse'
function Example() {
return <Collapse>
<Collapse.Header>Open</Collapse.Header>
<Collapse.Body animation={{
close: {
opacity: 0,
},
open: {
opacity: 1
},
transition: {
open: {duration: 0.2, ease: [0.3, 0.6, 0.3, 0.2]},
close: {duration: 0.1, ease: [0.3, 0.6, 0.3, 0.2]},
},
}}>
:)
</Collapse.Body>
</Collapse>
}
MIT © kaprisa57@gmail.com
FAQs
React Collapse Component
We found that @idui/react-collapse demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.