BrickButton 块状按钮

更新时间:2023-10-12 08:00:16下载pdf

BrickButton是在 Button 功能的基础上进行的丰富。

代码演示

说明:详细 Demo 可参考BrickButton Demo

import { BrickButton } from "tuya-panel-kit"; <BrickButton text="loading" loading={true} />;

交互演示

BrickButton 块状按钮

API

style

容器样式。

类型 必传 默认值
ViewPropTypes.style null

onPress

点击事件。

类型 必传 默认值
()=> void () => {}

onChange

事件监听集合。

  • onShowUnderlay:当底层的颜色被显示的时候调用。
  • onHideUnderlay:底层的颜色被隐藏的时候调用。
类型 必传 默认值
(eventName, ...args) => void () => {}

loading

是否显示读取的状态。

类型 必传 默认值
boolean false

text

按钮文字。

类型 必传 默认值
PropTypes.string PropTypes.array

textStyle

按钮文字样式。

类型 必传 默认值
Text.propTypes.style null

type

按钮类型。

  • primary:长条型。
  • primaryGradient:长条型带渐变。
  • primaryBorder:长条形带圆角。
  • normal:正常大小按钮。
  • small:小型按钮。
类型 必传 默认值
oneOfType primary

wrapperStyle

按钮内部包括的内容样式。

类型 必传 默认值
ViewPropTypes.style null

underlayColor

按钮点按时的颜色。

类型 必传 默认值
ColorPropType null

showUnderlay

是否显示点击时的按钮颜色。

类型 必传 默认值
ColorPropType true

loadingColor

loading 组件主颜色。

类型 必传 默认值
ColorPropType #fff

loadingBackground

loading 背景颜色。

类型 必传 默认值
number rgba(0, 0, 0, 0.1)

loadingSize

loading 大小。

类型 必传 默认值
'small' | 'large' | number ‘small’

loadingStrokeWidth

loading 外边框粗细。

类型 必传 默认值
number 2

background

渐变背景。

类型 必传 默认值
object { x1: '0%', y1: '0%', x2: '0%', y2: '100%', stops: { '0%': 'red', '30%': 'blue', '100%': 'yellow', }, }