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

@c8s/masonry

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@c8s/masonry

[![github](https://badgen.net/badge//nju33,c8s/000?icon=github&list=1)](https://github.com/nju33/c8s/tree/master/components/masonry) [![npm:version](https://badgen.net/npm/v/@c8s/masonry?icon=npm&label=)](https://www.npmjs.com/package/@c8s/masonry) [![typ

0.0.4
latest
npm
Version published
Maintainers
2
Created
Source

@c8s/masonry

github npm:version typescript license browserslist code style:prettier

Usage

/**
 * As to prepare of using the `Masonry`
 * 
 * ```sh
 * yarn add @c8s/masonry react @types/react
 * ```
 */
import Masonry from '@c8s/masonry';

Example

const createItem = (_: any, i: number) => {
  const col = i % 5 === 1 ? 2 : 1;
  return {
    col,
    style: {
      background: randomcolor({
        luminosity: 'dark',
      }),
    },
  };
};

const items = [...Array(10)].map(createItem);

() => (
  <Masonry col={3} gutter={10}>
    {({Item}) => {
      return (
        <>
          {items.map((style, i) => {
            return (
              <Item
                key={i}
                assets={[
                  {
                    href: `https://dummyimage.com/500x500`,
                    as: 'image',
                  },
                ]}
                index={i}
                col={style.col}
              >
                <div style={{display: 'block'}}>
                  <img
                    src="https://dummyimage.com/500x500"
                    style={{
                      maxWidth: '100%',
                      display: 'block',
                    }}
                  />
                  <div
                    style={{
                      ...style.style,
                      maxWidth: '100%',
                      color: '#000',
                    }}
                  >
                    Lorem ipsum dolor sit amet, consectetur adipiscing
                    elit, sed do eiusmod tempor incididunt ut labore et
                    dolore magna aliqua. Ut enim ad minim veniam, quis
                    nostrud exercitation ullamco laboris nisi ut aliquip
                    ex ea commodo consequat. Duis aute irure dolor in
                    reprehenderit in voluptate velit esse cillum dolore eu
                    fugiat nulla pariatur. Excepteur sint occaecat
                    cupidatat non proident, sunt in culpa qui officia
                    deserunt mollit anim id est laborum.
                  </div>
                </div>
              </Item>
            );
          })}
        </>
      );
    }}
  </Masonry>
);

Contributors

Thanks goes to these wonderful people (emoji key):



📖

Aki-Japan

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

FAQs

Package last updated on 09 Jan 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