smart-background 自动生成符号背景的 react 组件,做滚动背景墙非常方便
Smart Background
An React Component Can Automatically Generate The Background
一个快速生成元素背景的 react 组件
Repository
github.com/yuanguandong/smart-background
Live demo
yuanguandong.github.io/smart-background/
Install
npm i smart-background -S
How to use
import React from 'react';
import Background from 'smart-background';
import { FaLaugh } from 'react-icons/fa';
export default () => {
return (
JUST DO IT
);
};
const styles = {
container: { width: '100%', position: 'relative', height: 350 },
content: {
width: '100%',
height: '100%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
flexDirection: 'column',
},
icon: { color: '#fff', fontSize: 120 },
text: { color: '#fff', fontSize: 36, fontWeight: 'bold' },
};
Props
property
description
type
defaultValue
required
symbols
元素 /字符 /符号集合
(string | ReactNode | Element)[ ]
['●']
false
random
符号是否随机生成位置和大小
{ fontSizeRange: number[] } | undefined
false
underlayColor
底衬颜色
string
false
underlayImage
底衬图片
string
false
symbolsStyle
符号样式
Object
{color: '#000', opacity: '0.3'}
false
rotate
符号旋转角度
number
0
false
symbolSize
符号大小
number
90
false
gap
符号间距
number
10
false
animation
滚动动画
{type: 'left' | 'right' | 'top' | 'bottom'; speed: number;}
false
exact
精确模式
boolean
false
false
childrenWrapClassName
子组件容器类名
string
false
childrenWrapStyle
子组件容器类名
React.CSSProperties
false
感觉以后会用到的就先点个 star 收藏吧!感谢!
目前尚无回复
falseReactbackground符号
今天全司所有使用 Uni-App 的 iOS 应用全闪退。 分析下来开了面容识别并联网就会闪退,怀疑是 uni-app 存在私自窃取用户信息的情况。 不区分 iOS 版本,14…
之前写了 对于依赖注入的思考 一文,得到了许多网友的指点,发现自己的理解存在很大的偏差。 经过一段时间的学习,我发现我要解决的问题和依赖注入这个名词的关系不大,这块要解决的问题…
看来看去已经挑花眼了 1+8t 865 目前的神 这个价位还能挑花眼? 那必须是 redmi k 系列啊 s22 好像前两天看到降到 3999 了 可以考虑 s20+…