1.0.3 • Published 6 years ago

z-mosaic v1.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

z-mosaic

A react component that create a mosaic on an image.

Install

npm install z-mosaic --save

Usage

Make sure that you have a parent block with specific width to wrap this component, or you will get a component with fullscreen width.

import React from "react";
import ReactDOM from "react-dom";
import ZMosaic from "z-mosaic";
const neko = "https://avatars0.githubusercontent.com/u/18083507?s=460&v=4";

ReactDOM.render(
  <div style={{ width: 200, height: 200 }}>
    <ZMosaic src={neko} width={80} height={50} top={35} left={100} />
  </div>,
  document.getElementById("app")
);

Demo

demo

Api

props

nametypedefaultdescription
srcstring""The image you want to generate mosaic
widthnumber0Mosaic's width
heightnumber0Mosaic's height
topnumber0Mosaic's position
leftnumber0Mosaic's position
classNamestring""Custom style's classname
1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago