StepCard

Code demo

Studio

import { ClassicStepCard } from 'tuya-panel-classic-kit';
import TuyaRNSvgs from 'tuya-panel-kit/lib/components/iconfont/svg/defaultSvg';
<ClassicStepCard onValueChange={value => console.log({ value })} />;

Nordic

import { NordicStepCard } from 'tuya-panel-nordic-kit';
import TuyaRNSvgs from 'tuya-panel-kit/lib/components/iconfont/svg/defaultSvg';
<NordicStepCard icon={TuyaRNSvgs.power} unit="%" />;

API

ClassicStepCard

ClassicStepCard

NameDescriptionTypeDefault
styleOutermost container styleStylePropnull
buttonStyleAdd and subtract button stylesStylePropnull
buttonWidthAdd or subtract button widthnumbercx(140)
buttonHeightAdd and subtract button background colorsnumbercx(48)
minusIconSubtraction button iconstringnull
buttonIconColorButton icon colorstring'#158CFB'
plusIconAdd button iconstringnull
buttonIconSizeButton icon sizenumbercx(16)
minusDisabledWhether to disable the subtraction buttonbooleanfalse
plusDisabledWhether to disable the add buttonbooleanfalse
valueValuenumber10
minMinnumber0
maxMaxnumber99
stepValueStep lengthnumber1
millisecondsHold down the intervalnumber500
onValueChangeValue change callback(value: number) => voidnull

NordicStepCard

NordicStepCard

NameDescriptionTypeDefault
iconStyleHeader icon styleStylePropnull
textStyleHeader text styleStylePropnull
valueStyleConcrete value styleStylePropnull
widthContainer widthnumbercx(327)
paddingContainer paddingnumber[][cx(24), cx(20), cx(24), cx(20)]
radiusThe container with rounded cornersnumbercx(16)
backgroundColorContainer background colorstring#FFF'
iconSizeHeader icon sizenumbercx(16)
iconColorHeader icon colorstring'#1082FE'
textHeader textstring'Temp'
fontColorHeader text word colorstring'rgba(0, 0, 0, 0.9)'
fontSizeHeader text word sizenumbercx(16)
fontWeightHeader text word weightstring | number400
valueSizeSpecific value word sizenumbercx(24)
valueColorSpecific value word colorstring'#000'
valueWeightSpecific value word weightstring | number500
unitUnitstringnull
styleOutermost container styleStylePropnull
buttonStyleAdd and subtract button stylesStylePropnull
buttonWidthAdd or subtract button widthnumbercx(140)
buttonHeightAdd and subtract button background colorsnumbercx(48)
minusIconSubtraction button iconstringnull
buttonIconColorButton icon colorstring'#158CFB'
plusIconAdd button iconstringnull
buttonIconSizeButton icon sizenumbercx(16)
minusDisabledWhether to disable the subtraction buttonbooleanfalse
plusDisabledWhether to disable the add buttonbooleanfalse
valueValuenumber10
minMinnumber0
maxMaxnumber99
stepValueStep lengthnumber1
millisecondsHold down the intervalnumber500
onValueChangeValue change callback(value: number) => voidnull
iconicon svg pathstring--
imageimage url,icon has a higher prioritystring--
iconBgSizeicon background sizenumbercx(50)
showIconWhether to display iconbooleantrue
showIconBgWhether to display icon backgroundbooleantrue
iconBgColoricon background color, only rgb、rgba or hexBackgroundType#158CFB
iconBgRadiusicon background radiusnumbercx(50)
imageRadiusimage radiusnumber0
tuya07:31