
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
expandable-grid
Advanced tools
React grid component with expandable items and adaptive functionality, crafted using position: absolute CSS.
React grid component with expandable items and adaptive functionality, crafted using position: absolute CSS.
The grid expandable component is an interactive layout tool designed to create grids with expandable and collapsible elements. This dynamic component allows users to reveal or hide content within the grid, enhancing the user experience by accommodating detailed information without overwhelming the interface. It functions similarly to an accordion mechanism, adapted for grid usage. When configured as a single-column grid, it transforms into a classic accordion, offering a familiar experience with a versatile twist.
npm i --save expandable-grid
or
yarn add expandable-grid
To build the example locally, clone the repository and run:
npm install
npm run build
cd example
npm install
npm run watch
Then open localhost:1234 in a browser.
You can check this component on https://codesandbox.io/
To quickly integrate the grid into your application, the only required properties are items and columns' count. When instantiated without any additional properties, the component defaults to a pre-configured grid setup.
import { ExpandableGrid, IExpandableGridItemProps } from 'expandable-grid';
import { FC } from 'react';
<ExpandableGrid
items={[Item, Item, Item, Item]}
columnsCount={3}
/>;
const Item: FC<IExpandableGridItemProps> = ({ onToggle, isExpanded, onClose, onExpand, index }) => {
return <div></div>;
};
You can enhance the visual presentation by applying custom classNames and inline styles to the grid elements.
import { ExpandableGrid, IExpandableGridItemProps } from 'expandable-grid';
import { FC } from 'react';
<ExpandableGrid
items={[Item, Item, Item, Item]}
columnsCount={3}
gridClassName={'grid-class-name'}
gridItemClassName={'grid-item-class-name'}
gridExpandedItemClassName={'grid-expanded-item-class-name'}
style={{ transitionDuration: '100ms' }}
itemStyle={{ transitionDuration: '200ms' }}
/>;
const Item: FC<IExpandableGridItemProps> = ({ onToggle, isExpanded, onClose, onExpand, index }) => {
return <div></div>;
};
You can define key parameters to control the spacing and sizing of the grid and its elements.
import { ExpandableGrid, IExpandableGridItemProps } from 'expandable-grid';
import { FC } from 'react';
// Constants parameters
<ExpandableGrid
items={[Item, Item, Item, Item]}
columnsCount={3}
parameters={{
rowGap: 10,
columnGap: 10,
itemHeight: 100,
expandedItemHeight: 150,
}}
/>;
// Adaptive variants
// The key for each parameter corresponds to the window width,
// and the value determines the parameter that will be applied at that specific width
<ExpandableGrid
items={[Item, Item, Item, Item]}
columnsCount={{ 320: 1, 768: 3, 1200: 6 }}
parameters={{
rowGap: { 320: 10, 768: 12, 1200: 16 },
columnGap: { 320: 10, 768: 12, 1200: 16 },
itemHeight: { 320: 100, 768: 150, 1200: 200 },
expandedItemHeight: { 320: 150, 768: 200, 1200: 300 },
}}
/>;
const Item: FC<IExpandableGridItemProps> = ({ onToggle, isExpanded, onClose, onExpand, index }) => {
return <div></div>;
};
const DEFAULT_PARAMETERS = {
rowGap: 20,
columnGap: 20,
itemHeight: 150,
expandedItemHeight: 350,
};
Distributed under the MIT license. See LICENSE for more information.
https://github.com/dPaskhin/expandable-grid/blob/master/LICENSE.md
git checkout -b feature/fooBar)git commit -m 'feat: add some fooBar')git push origin feature/fooBar)FAQs
React grid component with expandable items and adaptive functionality, crafted using position: absolute CSS.
The npm package expandable-grid receives a total of 1 weekly downloads. As such, expandable-grid popularity was classified as not popular.
We found that expandable-grid 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.