
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
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
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
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.