Socket
Socket
Sign inDemoInstall

@compeon/timepicker

Package Overview
Dependencies
32
Maintainers
11
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @compeon/timepicker

Simple timepicker using react


Version published
Maintainers
11
Install size
186 kB
Created

Readme

Source

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

Keywords

FAQs

Last updated on 21 Sep 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc