0.0.8 • Published 3 years ago

@compeon/timepicker v0.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

COMPEON Timepicker

Simple time picker component built with react and styled-components.

Screenshot

Installation

yarn add @compeon/timepicker

Install styled-components

yarn add styled-components

Usage

import CompeonTimepicker from '@compeon/timepicker'

class Timepicker extends React.Component {
  state = {
    value: '17:30'
  }

  handleChange = value => this.setState({ value })

  render () {
    return (
	    <CompeonTimepicker onChange={this.handleChange} value={this.state.value}>
	      <input />
 	    </CompeonTimepicker>
 	  )
  }
}

Props

propdescriptiontypedefaultexample
classNameThe class name to be applied to the outermost div of the time pickerstring
dialogClassNameThe class name to be applied to the dialog of the time pickerstring
fromLower time boundary for the time range to pick from. If this prop is set, to has to be set as wellstring"10:00"
inputClassNameThe class name to be applied to the child of the time pickerstring
minutesPerStepThe amount of minutes to add or subtract when the user changes the minutes via the arrow buttons or the mouse wheelint15
onBlurFunction that is called when the time picker is closedfunction
onChangeFunction that is called when the value of the time picker changesfunction
onFocusFunction that is called when the time picker is focussedfunction
toUpper time boundary for the time range to pick from. If this prop is set, from has to be set as wellstring"17:30"
valueThe value to currently display. In case the initial value is outside of the specified time range, the time picker will immediately call onChange with a value that is in rangestring"00:00" "22:45"

Author

Gerrit Seger (gseger@compeon.de)

COMPEON

License

MIT

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

4 years ago

0.0.2

5 years ago

0.0.1

6 years ago