Timer

The Timer component provides a timer that will trigger a predefined callback when the time is up. An example use case is for the timing of quizzes.

Example:

<Timer 
    id='test-quiz'
    active={true} 
    duration={50} 
    onTimeUp={() => {
      alert( 'done' );
    }}
/>

Options:

  • id: the unique string ID for the timer. The timer component is persistent over page refreshes. Required.
  • active: boolean flag that can be toggled to start or pause the timer. Default: false.
  • duration: Duration in number seconds for the timer. Required.
  • onTimeUp: Callback function invoked when the timer runs out. Required.

results matching ""

    No results matching ""