UNPKG

phoenix-components-library

Version:

Component library for Phoenix Frontend Projects.

45 lines (35 loc) 1.32 kB
# Datepicker ### Usage ```js import { Datepicker } from 'phoenix-components-library'; render() { return ( <Datepicker format={text('Format', 'YYYY-MM-DD H:m:s')} placeholder={text('Placeholder', 'Placeholder')} onDatepickerOkClick={action('onClick')} defaultValue={new Date()} /> ); } ``` ### Live Example <!-- STORY --> ### Properties - `format` - to set the date format, refer to **moment.js** - `placeholder` - placeholder of date input - `defaultValue` - to set default date - `showTime` - to provide an additional time selection - `onDatepickerOkClick` - callback when click ok button - `onDatepickerChange` - a callback function, can be executed when the selected time is changing | propName | propType | defaultValue | isRequired | | ------------- | -------- | ------------ | ---------- | | name | string | - | | | type | string | text | | | value | string | - | | | placeholder | string | false | | | class | string | - | | | color | string | - | | | onChangeInput | func | - | | | onFocusInput | func | - | | ### Roadmap