1.0.2 • Published 3 years ago
react-glass-surface v1.0.2
react-glass-surface
Introduction
react-glass-surface is:
- ✨ A container styled like a glass pane (see: glassmorphism)
- 💞 Behaves exactly like a
div
and doesn't add another layer - 🖌 Fully-Customizable and easy-to-use
- 🅾 Coming with zero dependencies
- 🖼 You can pass
style
andclassName
to apply your own styles - ♻ All props are passed to the container (e.g.
onClick
)
Installation
- Using yarn
yarn add react-glass-surface
- Using npm
npm install react-glass-surface
Make sure that your React
version is > 16.8
!
Basic Usage
import Glass from 'react-glass-surface'
const YourComponent = () => {
return (
<Glass>
<p>Content</p>
</Glass>
)
}
PROPS
There are different props available to customize the container. None of these are needed. Keep in mind that the css property backdrop-filter
can only be styled via className
. The default values for these props are actually styled via className
.
background: ?string = 'rgba(255, 255, 255, 0.2)'
border: ?string = 'none'
borderRadius: ?string = '0px'
boxShadow: ?string = 'none'
className: ?string = ''
style: ?Object = {}