0.1.3 • Published 4 years ago

react-zoom-children v0.1.3

Weekly downloads
2
License
-
Repository
github
Last release
4 years ago

react-zoom-children


NPM version build status codecov node version npm download

🔍zoom img or any childNode for react. (Inspired by drawer, zooming)

Example

http://becarchal.github.io/react-zoom-children

Usage

import ReactZoomChildren from 'react-zoom-children';
import React from 'react';
import ReactDom from 'react-dom';

ReactDom.render(
  <ReactZoomChildren>
    {children}
  </ReactZoomChildren>
, mountNode);

Install

react-zoom-children

npm install -S react-zoom-children

Browser Support

IEChromeFirefoxOperaSafari
IE 10+ ✔Chrome 31.0+ ✔Firefox 31.0+ ✔Opera 30.0+ ✔Safari 7.0+ ✔

API

propstypedefaultdescription
prefixstring'rzc'prefix class
wrapperClassNamestringnullwrapper class name
enlargedContentReactElement|nullnullEnlarged content
transitionDurationnumber0.4Transition duration in seconds
transitionTimingFunctionstring'cubic-bezier(0.4, 0, 0, 1)'Transition timing function
maskColorstring'rgb(255, 255, 255)'mask background color
maskOpacitynumber1mask background opacity
styleobject{}wrapper style
maskStyleobject{}mask style
scaleBasenumber1The base scale factor for zooming. By default scale to fit the window
zIndexnumber998The z-index that the wrapper will be added with
customSizeobject|string|nullnullScale (zoom in) to given width and height. Ignore scaleBase if set. Alternatively, provide a percentage value relative to the original image size
onOpenfunction() => {}A callback function that will be called when a target is opened and transition has ended. It will get the target element as the argument
onClosefunction() => {}Same as above, except fired when closed
onBeforeOpenfunction() => {}A callback function that will be called before open
onBeforeClosefunction() => {}A callback function that will be called before close

Development

npm install
npm start
npm run coverage

欢迎参与贡献

发现了错误? 向我发起一个 PR 吧! 参考 Commit message 和 Change log 编写指南 - 阮一峰的网络日志 提交 commit 即可。

致谢

  • father Library toolkit based on rollup, docz, storybook, jest, prettier and eslint,整合工具包简化了开源包开发,
  • drawer, zooming