New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

masonic

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

masonic

A React virtualized masonry component for the window based on the original by Brian Vaughn

  • 1.0.0-alpha
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Masonic

A React virtualized masonry component for the window based upon Brian Vaughn's react-virtualized and further inspired by react-window.

Installation

Find Masonic on NPM

yarn add masonic or npm i masonic

Requirements

React >16.8 is a minimum requirement because this package relies on and provides React hooks.

Motivation

The only use case I have ever had for a masonry component is relative to the browser window. Brian's Masonry component is great for its performance and versatility, but I wanted something more suited to my needs and something with an API that more closely matched react-window's awesome API.

API Documentation

Masonry

A virtualized masonry component which only renders items currently visible in the window.

Prop types

List

A virtualized list component which only renders items currently visible in the window. This is just a single column Masonry component.

Prop types

useInfiniteScroller

A React hook for easily creating an infinite scrolling Masonry or List component.

Options

memoizeOne

Differences from react-virtualized/Masonry

There are actually quite a few differences between these components and the originals, despite the overall design being highly inspired by them.

  1. The original component requires a <CellMeasurer>, cellPositioner, and cellMeasurerCache. In Masonic this functionality=is built in and uses resize-observer-polyfill for tracking cell size changes.

  2. The implementation for updating cell positions and sizes is also much more efficient in this component because only specific cells and columns are updated when cell sizes change, whereas in the original a complete reflow is triggered.

  3. This component only renders relative to its parent container's width and the browser window's height. The original component is tuned for rendering inside a parent container and not the window.

  4. The API is a complete rewrite and because of much of what is mentioned above, is much easier to use in my opinion.

Credits

Keywords

FAQs

Package last updated on 27 Mar 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc