0.11.7 • Published 12 months ago

masua v0.11.7

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

masua

Simple masonry layout library in TypeScript. Initially forked from minimasonry by Spope.

Installation

⚠️ This plugin is published as TypeScript and JSX (for the React plugin) see this post on 𝕏 for the reasoning. Make sure to add the necessary types listed below if they are missing in your project and align your tsconfig.json with { compilerOptions: { lib: ['DOM', 'ES2020'], module: 'Preserve', jsx: 'react-jsx' }} as used for this project. React is only required when the masua/react export is used.

bun install masua
bun install @types/bun # or @types/node
bun install @types/react # for React export

Usage

import { grid } from 'masua'

grid(document.querySelector('#my-grid'))
// With configuration options.
grid(document.querySelector('#my-custom-grid'), {
  gutter: 20,
  baseWidth: 300,
  minify: false,
  surroundingGutter: true,
  singleColumnGutter: 10,
  direction: 'rtl',
  wedge: true,
})

React

import { Grid } from 'masua/react'

const MyGrid = () => (
  <Grid disabled={window.innerWidth < 501} gutter={50}>
    <Box />
    <Box size={3} />
    <Box size={2} />
    <Box />
    <Box size={6} />
    <Box size={4} />
  </Grid>
)
0.11.6

12 months ago

0.11.7

12 months ago

0.11.5

1 year ago

0.11.4

1 year ago

0.11.3

1 year ago

0.11.2

1 year ago

0.11.1

1 year ago

0.11.0

1 year ago

0.10.3

1 year ago

0.10.2

1 year ago

0.10.1

1 year ago

0.10.0

1 year ago

0.9.0

1 year ago