
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
react-expandable
Advanced tools
$ npm install react-expandable --save
import React from 'react';
import Expandable from './index';
import styled from 'styled-components';
const Item = styled.div`
display: flex;
padding: 12px;
`;
const ItemHeader = styled.div`
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px;
`;
const ItemTitle = styled.div`
`;
const ItemIcon = styled.div`
`;
export default () => (
<Expandable
headers={[
({ isOpened }) => (
<ItemHeader>
<ItemTitle>Tab1</ItemTitle>
<ItemIcon>{isOpened ? '-' : '+'}</ItemIcon>
</ItemHeader>
),
({ isOpened }) => (
<ItemHeader>
<ItemTitle>Tab2</ItemTitle>
<ItemIcon>{isOpened ? '-' : '+'}</ItemIcon>
</ItemHeader>
),
({ isOpened }) => (
<ItemHeader>
<ItemTitle>Tab3</ItemTitle>
<ItemIcon>{isOpened ? '-' : '+'}</ItemIcon>
</ItemHeader>
),
]}
enableMultiOpen
>
<Item>
first item<br />
first item<br />
first item<br />
</Item>
<Item>
second item
</Item>
<Item>
third item
</Item>
</Expandable>
);
Property | Type | Default | Description |
---|---|---|---|
children* | arrayOf (element) | An array of react elements, these are the tabs. | |
headers* | arrayOf (func) | An array of functions that returns react elements. | |
The function will be called with an object that has isOpened option. | |||
springOptions | shape {stiffness: number damping: number precision: number } | React motion configurations. | |
More about this here | |||
enableMultiOpen | bool | false | Whether you want to enable multiple opens or not. |
To contribute, follow these steps:
npm install
npm start
localhost:3000
MIT
FAQs
ReactExpandable
The npm package react-expandable receives a total of 3 weekly downloads. As such, react-expandable popularity was classified as not popular.
We found that react-expandable 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.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.