0.4.0 • Published 3 years ago

@totebox/ui v0.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@totebox/ui

安装

npm i @totebox/ui

确保你的项目中已经安装了以下依赖以及相应的版本:

npm i classnames@^2.2.0 react@^16.8.0 react-dom@^16.8.0 react-transition-group@^4.3.0

使用

import { Animate, Loading, Modal, /*other components...*/ } from '@totebox/ui'

组件 API

Animate

Props

PropsDescriptionTypeDefault
in显示/隐藏元素Booleanfalse
animation动画展现方式String"fade"
duration动画展现时间Number400
其他属性参考:react-transition-group

animation

animation
fadefadeDownfadeLeftfadeRight
fadeUp
flipflipXflipY
rotaterotateDownLeftrotateDownRightrotateUpLeft
rotateUpRight
zoom

Example

<Animate in={visible} animation="zoom" duration="600">
  <div className="loading" />
</Animate>

Loading

Props

PropsDescriptionTypeDefault
visible组件显示/隐藏Booleanfalse
其他属性参考:Animate

Example

<Loading visible={loading} />

Modal

Props

PropsDescriptionTypeDefault
titleModal 标题String"Title"
visibleModal 是否可见Booleanfalse
animation动画展现方式String"zoom"
onClose点击右上角叉后的回调Functionnoop

Example

const [modalVisible, setModalVisible] = useState(true);

<Modal
  title="Example"
  visible={modalVisible}
  animation="flip"
  onClose={() => setModalVisible(false)}
>
  <p>Message...</p>
</Modal>

License

MIT © nicolaszhao

0.4.0

3 years ago

0.3.0

4 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago