0.0.3 • Published 1 year ago

react-editable-datetime-picker v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-editable-datetime-picker

Install

npm install react-editable-datetime-picker

# Use Yarn
yarn add react-editable-datetime-picker

Usage

import { useRef, useState } from "react"
import { DateTimePicker } from "react-editable-datetime-picker"

export default function Home() {
  const ref = useRef(null);
  return (
    <>
      <input ref={ref} type="text" defaultValue="" onFocus={() => setFocus(true)} />
      <DateTimePicker
        isTime={true}
        parentRef={ref}
        mainColor="#ff4545"
        currentTextColor="#fff"
        textColor="#000"
        outlineColor="#ff4545"
        backgroundColor="#ffdede"
        borderColor="#de6a6a"
      />
    </>
  )
}

Props

namedescription
isTimeSet whether to display the time
parentRefSet Ref to work with Picker
mainColorSet main accent color
currentTextColorSets the text color to display the selected date
textColorSets the text color to display
outlineColorSets the outline color for entering the time
backgroundColorSets the background color of the datetimepicker
borderColorSets the border color of the datetimepicker