TimerPicker

TimerPicker is a time period selection component, that is, select the start time and end time.

Code demo

Basic use of time period selector

import { TimerPicker } from 'tuya-panel-kit'
const [time, setTime] = React.useState({ startTime: 0, endTime: 0 });
<TimerPicker
style={{ marginTop: 10 }}
startTime={time.startTime}
endTime={time.endTime}
onTimerChange={(startTime, endTime) => setTime({ startTime, endTime })}
/>

Time period selector with prefix position

import { TimerPicker } from 'tuya-panel-kit'
const [time, setTime] = React.useState({ startTime: 0, endTime: 0 });
<TimerPicker
style={{ marginTop: 10 }}
startTime={time.startTime}
endTime={time.endTime}
prefixPosition="left"
onTimerChange={(startTime, endTime) => setTime({ startTime, endTime })}
/>

API

extends PickerViewProps

tuya01:08