All Projects → itsrennyman → react-plock

itsrennyman / react-plock

Licence: other
Plock is a responsive masonry layout implementation for React.

Programming Languages

typescript
32286 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-plock

angular-masonry
A simple lightweight library to use Masonry layout in Angular
Stars: ✭ 11 (-90.68%)
Mutual labels:  masonry, masonry-layout
Justified Gallery
Javascript library to help creating high quality justified galleries of images. Used by thousands of websites as well as the photography community 500px.
Stars: ✭ 1,512 (+1181.36%)
Mutual labels:  masonry, masonry-layout
react-native-masonry-list
The Masonry List implementation which has similar implementation as the `FlatList` in React Native
Stars: ✭ 255 (+116.1%)
Mutual labels:  masonry, masonry-layout
Screenadaptationkit
🎨iOS rapidScreen Compatible AdapterKit(Deprecate)
Stars: ✭ 70 (-40.68%)
Mutual labels:  masonry
Ordnung
The 1kb alternative to Isotope
Stars: ✭ 79 (-33.05%)
Mutual labels:  masonry
Shuffle
Categorize, sort, and filter a responsive grid of items
Stars: ✭ 2,170 (+1738.98%)
Mutual labels:  masonry
Vue Magic Grid
🧙‍♂️🔌 Responsive Magic Grid for Vue
Stars: ✭ 162 (+37.29%)
Mutual labels:  masonry
React Native Masonry
🙌 A pure JS react-native component to render a masonry~ish layout for images with support for dynamic columns, progressive image loading, device rotation, on-press handlers, and headers/captions.
Stars: ✭ 1,094 (+827.12%)
Mutual labels:  masonry
Niui
Lightweight, feature-rich, accessible front-end library
Stars: ✭ 152 (+28.81%)
Mutual labels:  masonry
Opensource
♨️ 分享GitHub优秀开源项目和主流开发使用的网站、解决问题方案收集以及学习网站或资料,涵盖了iOS, macOS X, Blockchain, Flutter, Weex, H5, Games, C++, Script等多方面的内容,其中iOS大致包涵以下内容:音视频;IM和直播;逆向开发;图像相关(OpenGL, Metal, GPUImage);内购(IAP), ApplePay和第三方支付;安全攻防和应用加固, 数据安全和算法;常用第三方库;导航栏和状态栏;侧边菜单;数据持久;蓝牙, 手势指纹面容ID解锁, 图片浏览器, 扫码, 下拉和上拉刷新, 指示器, Toast, Menu, Sensor, Privacy, WebView和进度条, 动画, 选择器, 搜索, 分享, 图片验证码, 设备相关信息, 广告, 高仿项目及Demo等。
Stars: ✭ 123 (+4.24%)
Mutual labels:  masonry
React Snuggle
An intimate and comfortable way to layout your components
Stars: ✭ 251 (+112.71%)
Mutual labels:  masonry
Savvior
A Salvattore and Masonry alternative without CSS-driven configuration or absolute CSS positioning
Stars: ✭ 122 (+3.39%)
Mutual labels:  masonry
Ngx Masonry
Angular Module for displaying a feed of items in a masonry layout
Stars: ✭ 102 (-13.56%)
Mutual labels:  masonry
Masonic
🧱 High-performance masonry layouts for React
Stars: ✭ 209 (+77.12%)
Mutual labels:  masonry
Vue Masonry Wall
A pure vue responsive masonry layout without direct dom manipulation and ssr support.
Stars: ✭ 79 (-33.05%)
Mutual labels:  masonry
egjs-grid
A component that can arrange items according to the type of grids
Stars: ✭ 188 (+59.32%)
Mutual labels:  masonry
React Xmasonry
Simple, minimalistic and featured native masonry layout for React JS.
Stars: ✭ 62 (-47.46%)
Mutual labels:  masonry
masonry-css
Create mosaic grid, like masonry, with css only
Stars: ✭ 17 (-85.59%)
Mutual labels:  masonry
react-mason
React Masonry grid
Stars: ✭ 13 (-88.98%)
Mutual labels:  masonry
Ragrid
Intrinsic first auto-layout flexbox grid
Stars: ✭ 249 (+111.02%)
Mutual labels:  masonry

Stars Latest Release

About Plock 🌈

Plock is a responsive masonry layout implementation for React. Very simple to use and easy to understand.

Can I see a demo? 👀

The demo is available for you here!

Getting Started 🤩

Install the package with yarn or npm:

$ npm install react-plock

The simplest way to use Plock is to import it in your React app:

import { Plock } from 'react-plock';

export function Pokemon() {
  return (
    <Plock>
      <div>Bulbasaur</div>
      <div>Ivysaur</div>
      <div>Venusaur</div>
    </Plock>
  );
}

And that's it! 🎉 🎉 🎉

By default, Plock will use this configuration:

const default = [
  { size: 640, columns: 1 },
  { size: 768, columns: 2 },
  { size: 1024, columns: 3 },
  { size: 1280, columns: 6 },
];

You can also override this prop by setting the breakpoints prop:

import { Plock, Breakpoint } from 'react-plock';

// For TS Breakpoint is the type for this property
const breakpoints: Breakpoint[] = [
  { size: 640, columns: 1 },
  { size: 1024, columns: 3 },
];

export function Pokemon() {
  return (
    <Plock breakpoints={breakpoints}>
      <div>Bulbasaur</div>
      <div>Ivysaur</div>
      <div>Venusaur</div>
    </Plock>
  );
}

You can use custom components as elements too:

import { Plock } from 'react-plock';

interface TileProps {
  children: React.ReactNode;
}

const Tile = ({ children }: TileProps) => {
  return (
    <div
      style={{
        height: '350px',
        background: '#ffeb3b',
      }}
    >
      {children}
    </div>
  );
};

export function Pokemon() {
  return (
    <Plock breakpoints={breakpoints}>
      <Tile>I love Plock! 💙</Tile>
      <Tile>I love React! 💛</Tile>
      <Tile>I love Javascript! 💝</Tile>
      <Tile>Give us a Star! 🌟</Tile>
    </Plock>
  );
}

The element resizing is automatically debounced with a delay of 200ms. You can override this delay by setting the debounce prop with a number in milliseconds.

import { Plock } from 'react-plock';

export function Pokemon() {
  return (
    <Plock debounce={1000}>
      <div>Bulbasaur</div>
      <div>Ivysaur</div>
      <div>Venusaur</div>
    </Plock>
  );
}

Also the gap between columns can be set by setting the gap prop (by default it's 10px):

import { Plock } from 'react-plock';

export function Pokemon() {
  return (
    <Plock gap="1rem">
      <div>Pikachu</div>
      <div>Charmander</div>
      <div>Squirtle</div>
      <div>Bulbasaur</div>
    </Plock>
  );
}

Needs also some extra styling? No problem, you can extend the default styles by setting the style or the className prop:

import { Plock } from 'react-plock';

export function Pokemon() {
  return (
    <Plock style={{ background: 'red' }} className="a-happy-class">
      <div>Pikachu</div>
      <div>Charmander</div>
      <div>Squirtle</div>
      <div>Bulbasaur</div>
    </Plock>
  );
}

TypeScript 🤓

Plock is totally type-safe and you can use it with TypeScript too, you can import the types and use them in your code:

import { Breakpoint, PlockProps } from 'react-plock';

Built With 🏗️

Versioning 🚦

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors 🙋

Stargazers 🌟

Stargazers repo roster for @itsrennyman/react-plock

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].