项目作者: damaera

项目描述 :
Frost glass effect, Acrylic Material react component
高级语言: JavaScript
项目地址: git://github.com/damaera/react-acrylic.git
创建时间: 2017-09-26T09:22:59Z
项目社区:https://github.com/damaera/react-acrylic

开源协议:MIT License

下载


npm version

React Acrylic

Frost glass effect, Acrylic Material react component

Inspired by Fluent Design’s Acrylic Material

This one uses html2canvas, which takes dynamic ‘screenshots’ of the content to blur.

Layer

Live Demo

Edit 6xp9vyjj23

https://6xp9vyjj23.codesandbox.io/

Usage

  1. import React, { Component } from 'react'
  2. Import Acrylic from 'react-acrylic'
  3. class YourComponent extends Component {
  4. render() {
  5. <Acrylic
  6. colorOverlay='#eee'
  7. opacity='0.4'
  8. position='fixed'
  9. top='100px'
  10. left='100px'
  11. width='300px'
  12. height='200px'
  13. blur={40}
  14. borderRadius='2px'
  15. borderRadius='2px'
  16. >
  17. <span>Hello Acrylic</span>
  18. </Acrylic>
  19. }
  20. }

Props

Props Default value
position 'fixed',
left 0,
top 0,
width 0,
height 0,
colorOverlay '#fff'
opacity 0.5
borderRadius 0
boxShadow null
blur 30