SliderCard

Demo

Studio

import { ClassicSliderCard, ClassicLargeSliderCard } from 'tuya-panel-classic-kit';
<ClassicSliderCard
style={{ marginTop: 20 }}
title="Slider Card"
icon={TuyaRNSvgs.power}
value={value}
unit="%"
handValueChange={setValue}
canTouchTrack
/>
<ClassicLargeSliderCard
icon={TuyaRNSvgs.power}
showIconBg
iconBgColor={{
deg: 90,
stops: {
'0%': 'red',
'100%': 'yellow',
},
}}
style={{ marginTop: 20 }}
title="Thick sliders"
unit="%"
value={value}
handSlidingComplete={setValue}
disabled
/>

Nordic

import { NordicLargeSliderCard } from 'tuya-panel-nordic-kit';
<NordicLargeSliderCard
title="The wind speed"
icon={TuyaRNSvgs.power}
maximumValue={enumValue.length - 1}
minimumValue={0}
value={0}
renderValue={value => enumValue[value]}
/>;

Acrylic

import { AcrylicSliderCard } from 'tuya-panel-acrylic-kit';
<AcrylicSliderCard
iconSize={20}
title="Function"
icon={IMAGE}
bothSideIcons={[
{ icon: IMAGE, isImage: true },
{ icon: IMAGE, isImage: true },
]}
bothSideIconIsImage
iconIsImage
value={value1}
bottomPromptTexts={['Low', 'Max']}
handValueChange={setValue1}
/>
<AcrylicSliderCard
style={{ marginTop: 20 }}
iconSize={20}
iconIsImage
title="Function"
icon={IMAGE}
bothSideIcons={[{ icon: TuyaRNSvgs.power }, { icon: TuyaRNSvgs.power }]}
value={value1}
bottomPromptTexts={['min', 'max']}
handSlidingComplete={setValue1}
/>
<AcrylicSliderCard
style={{ marginTop: 20 }}
iconSize={20}
title="Function"
icon={TuyaRNSvgs.power}
maximumValue={enumValue.length - 1}
minimumValue={0}
value={0}
bottomPromptTexts={['min', 'max']}
renderValue={value => enumValue[value]}
/>

API

ClassicSliderCard

NameDescriptionTypeDefault
sliderPropsSlider props, Doc:https://panel-docs.tuyacn.com/docs/data-entry/sliderSliderProps--
styleOuter container StyleStyleProp--
titleStyleTitle container StyleStyleProp--
titleTextStyleTitle text StyleStyleProp--
contentStyleContent container StyleStyleProp--
thumbStyleSlider thumb StyleStyleProp--
themeSliderProps.theme Doc:https://panel-docs.tuyacn.com/docs/data-entry/sliderRecord--
backgroundColorComponent background colorstring--
radiusComponent background radiusnumber--
maximumValuemax valuenumber100
minimumValuemin valuenumber0
trackStyleSliding groove patternStyleProp--
valueSlider valuenumber--
unitValue unitstring--
stepValueSlider Step lengthnumber1
hasControlWhether the slider is controlledbooleanfalse
canTouchTrackWhether the value can be changed by touching the track.booleanfalse
disabledWhether to disable or notboolean--
handValueChangeValue change callback(value: number) => void--
handSlidingCompleteValue change completed callback(value: number) => void--
typeType of the slider: parcel: type of the parcel"parcel" | "normal"normal
renderMinimumTrackCustom rendering of the tracks less than the current value.() => ReactElement>--
renderTitleCustom rendering Title(value: number) => ReactElement>--
paddingOuter container Padding [top, right, bottom, left]number[]--
width--number--
titleTitlestring--
showTitleShow title or notbooleantrue
titleFontColorTitle font colorstring--
titleFontSizeTitle font sizenumber--
titleFontWeightTitle font weight"normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900"--
valueFontColorValue font colorstring--
valueFontSizeValue font sizenumber--
valueFontWeightValue font weight"normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900"--
sliderBgColorSlider background colorstring--
sliderGrooveBgColorSliding groove background colorstring--
sliderThumbColorSlider thumb colorstring--
sliderThumbSizeSlider thumb sizenumber--
sliderThumbRadiusSlider thumb radiusnumber--
bottomPromptTextsBottom left and right prompt text[string, string]--
bottomPromptTextFontSizeButton prompt text font sizenumber--
bottomPromptTextFontColorButton prompt text font colorstring--
bottomPromptTextFontWeightButton prompt text font weight"normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900"--
bothSideIconsICONS on both sides of the slider[IconItem, IconItem]--
bothSideIconSizeSize of ICONS on both sides of the slidernumber--
bothSideIconColorColor of ICONS on both sides of the sliderstring--
renderValueCustom value rendering(value: number) => ReactNode--
iconIsImageWhether the card icon is a picturebooleanfalse
iconicon svg pathstring--
iconSizeicon sizenumbercx(24)
iconBgSizeicon background sizenumbercx(50)
showIconBgWhether to display icon backgroundbooleantrue
iconColoricon colorstring#fff
iconBgColoricon background color, only rgb、rgba or hexBackgroundType#158CFB
iconBgRadiusicon background radiusnumbercx(50)
tuya07:31