React-sim
GitHub

Timer

You can also explicitly specify your timer, so it can be anywhere you want in the controls, not just at the very end (default).

0
100
The Timer takes the following props:

The Default timer properties, plus:

NameDescription
maxTime
integer, 100 by default
At which position the timer ends.
minTime
integer, 0 by default
At which position the timer starts. Can be negative.
label
string, optional
The label which will describe the control.
name
string, optional
The name of the control. If not specified, label is used.
shouldDisplayLabel
boolean, default true
Whether the label should be displayed.
shouldDisplayMaxValue
boolean, default true
Whether the maximum value should be displayed to the right of the range.
shouldDisplayMinValue
boolean, default true
Whether the minimum value should be displayed to the left of the range.
shouldDisplayValue
boolean, default true
Whether the value should be displayed next to the label.
showTime
boolean, true by default
Whether the time block (i.e. slider and time value) is going to be shown.
showTimeSlider
boolean, true by default
Whether the time slider is going to be shown.
time
number
The current value of time shown on this Timer
updateTime
function
The function that will update this Timer's time when the

Unlike the other built-in controls, Timer does not take a value or a setValue parameter.

<Model
showTimer={false}
controls={{
type: 'timer',
label: 'My explicit timer',
}}
/>

If you explictly include a timer through the controls prop of Model, then the default timer won't be added at the end.

Edit this page on GitHub
Previous:
Range
Next:
Custom controls
React-SimGitHub