0.0.7 • Published 3 years ago

@taisuke-j/react-grid-view v0.0.7

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

React Grid View

Build Status

npm i @taisuke-j/react-grid-view

Grid view of repeatable React components. Pass an array of data and a component as props, and it will render a grid view. There are also optional props for customization. Suggestions and pull requests for optimization are welcome.

Grid View

Minimum settings

<Grid
  dataset={peopleData} // Array of data
  component={<PersonCard />} // Component
  columns={3} // Number of columns in a row
/>

With optional settings

<Grid
  dataset={peopleData} // Array of data
  component={<PersonCard />} // Component
  columns={3} // Number of columns in a row
  distance={10} // Distance between components in px values
  enhancer={enhancerFunc} // Function to process each component
/>

npm start to see an example (Node v10.15.1+).

It's a fixed grid

The number of columns in a row is specified as a prop, and it renders all columns with common height.

This library does not have any responsive settings built in. If you need to change the number of the columns depending on the viewport width, you probably want to trigger your own function that updates the columns prop, which represents the number of columns in a row.

Browser Support

It uses flexbox for CSS, which should be supported for most of the modern browsers.

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago