EnumSliderCard

Demo

Acrylic

const data = [
{
label: 'close',
key: '0',
},
{
label: 'one',
key: '1',
},
{
label: 'two',
key: '2',
},
{
label: 'three',
key: '3',
},
];
export default () => {
const [activeKey1, setActiveKey1] = useState('3');
return (
<ListView
style={{ backgroundColor: '#f9f9f9', minHeight: 200 }}
list={[
{
title: 'Acrylic',
content: (
<View>
<AcrylicEnumSliderCard
data={data}
title="AcrylicEnumSliderCard"
icon={TuyaRNSvgs.power}
bottomPromptTexts={['Off', 'Max']}
activeKey={activeKey1}
handSlidingComplete={(key, index) => setActiveKey1(key)}
/>
<View style={{ marginTop: 20 }}>
<Button
onPress={() => setActiveKey1('2')}
title="click to change key 2"
/>
</View>
</View>
),
},
]}
/>
);
};

API

AcrylicEnumSliderCard

NameDescriptionTypeDefault
datadataSourceEnumList[](required)
activeKeyThe currently selected keystring--
handSlidingCompletevalue change completed callback(key: string, index: number) => void--
handValueChangevalue change callback(key: string, index: number) => void--
sliderDotSizeSize of dot on scroll barnumber--
sliderDotColorThe color of the dot to the right of the valuestring--
activeSliderDotColorThe color of the dot to the left of the valuestring--
styleOuter container StyleStyleProp--
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)
sliderPropsSlider props, Doc:https://panel-docs.tuyacn.com/docs/data-entry/sliderSliderProps--
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--
trackStyleSliding groove patternStyleProp--
valueSlider valuenumber--
unitValue unitstring--
hasControlWhether the slider is controlledbooleanfalse
canTouchTrackWhether the value can be changed by touching the track.booleanfalse
disabledWhether to disable or notboolean--
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
tuya07:31