
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
redux-react-collapse-pane
Advanced tools
Install redux-react-collapse-pane: ```bash npm i redux-react-collapse-pane
Install redux-react-collapse-pane:
npm i redux-react-collapse-pane
# or for yarn
yarn add redux-react-collapse-pane
Once installed you can import the CollapsePane
component in your code.
import { CollapsePane } from "redux-react-collapse-pane";
To resize your components you need to wrap it out with CollapsePane frame. The idea of this implementation of pane is to control the collapsing and resizing from the parent component. This will enable you to persist collapse pane in redux and update the pane from redux state.
The required props are:
<CollapsePane
childSizes={sizes}
collapsedSize={100}
onSizeChanged={(sizes: [number, number]) => onSizeChanged(sizes)}
collapsed={collapsed}
onCollapse={() => onCollapse()}
onExpand={() => onExpand()}
>
<div>First</div>
<div>Second</div>
</CollapsePane>
This will be vertical panel, it's left element will be collapsible.
export interface CollapsePaneProps {
collapsed: boolean,
/**
* this sizes are relative
* ex: [1,2] second element is two times bigger than the first
*/
childSizes: [number, number];
/** this size is absolute, and is using for collapsed element */
collapsedSize: number;
onSizeChanged: (sizes: [number, number]) => void;
/** by default vertical */
horizontal?: boolean;
/** if horizontal inverted collapse pane will collapse left element
* if vertical inverted collapse pane will collapse bottom element
*/
inverted?: boolean;
// you can use custom collapse button
collapseButton?: React.ReactElement;
// you can use custom expand button
expandButton?: React.ReactElement;
// color of the separator line
separatorColor?: string;
// color of the moving separator line
movingSeparatorColor?: string;
// width of the separator line
separatorWidth?: number;
onCollapse: () => void;
onExpand: () => void;
/**
* offset in % from top to bottom or from left to right, 50 is center
*/
collapseButtonOffset?: number;
/**
* positions in pixels left to right and top to bottom in which the delimiter will be snapped
*/
snapPoints?: number[];
children: [React.ReactChild, React.ReactChild]
}
FAQs
Install redux-react-collapse-pane: ```bash npm i redux-react-collapse-pane
We found that redux-react-collapse-pane 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's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
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.