Gathering detailed insights and metrics for @datepicker-react/styled
Gathering detailed insights and metrics for @datepicker-react/styled
Gathering detailed insights and metrics for @datepicker-react/styled
Gathering detailed insights and metrics for @datepicker-react/styled
react-datepicker-styled-components
Fork of react-datepicker to use styled components. Super hacky, you probably shouldn't use it.
@compeon/datepicker
Simple datepicker using react, styled-components and date-fns
react-native-styled-datepicker
A Datepicker you can style as you wish
@compeon-os/datepicker
Simple datepicker using react, styled-components and date-fns
An easily internationalizable, accessible, mobile-friendly datepicker library for the web, build with styled-components.
npm install @datepicker-react/styled
Typescript
Module System
Node Version
NPM Version
JavaScript (65.88%)
TypeScript (34.1%)
HTML (0.02%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
330 Stars
326 Commits
55 Forks
9 Watchers
27 Branches
15 Contributors
Updated on Apr 02, 2025
Latest Version
2.8.4
Package Id
@datepicker-react/styled@2.8.4
Unpacked Size
345.13 kB
Size
70.47 kB
File Count
83
NPM Version
lerna/3.22.1/node@v16.8.0+x64 (darwin)
Node Version
16.8.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
2
An easily internationalizable, accessible, mobile-friendly datepicker library for the web, build with styled-components.
For examples of the datepicker in action, go to https://datepicker-react.netlify.com/.
OR
To run that demo on your own computer:
yarn install && bootstrap
yarn storybook
1yarn add @datepicker-react/styled styled-components
1import {DateRangeInput, DateSingleInput, Datepicker} from '@datepicker-react/styled'
The DateRangeInput
is a fully controlled component that allows users to select a date range. You
can control the selected dates using the startDate
, endDate
, and onDatesChange
props as shown
below. Similarly, you can control which input is focused as well as calendar visibility (the
calendar is only visible if focusedInput
is defined) with the focusedInput
and onFocusChange
props as shown below.
Here is the minimum REQUIRED setup you need to get the DateRangeInput
working:
IE11 is not supported
1import React, {useReducer} from 'react' 2import {DateRangeInput} from '@datepicker-react/styled' 3 4const initialState = { 5 startDate: null, 6 endDate: null, 7 focusedInput: null, 8} 9 10function reducer(state, action) { 11 switch (action.type) { 12 case 'focusChange': 13 return {...state, focusedInput: action.payload} 14 case 'dateChange': 15 return action.payload 16 default: 17 throw new Error() 18 } 19} 20 21function App() { 22 const [state, dispatch] = useReducer(reducer, initialState) 23 24 return ( 25 <DateRangeInput 26 onDatesChange={data => dispatch({type: 'dateChange', payload: data})} 27 onFocusChange={focusedInput => dispatch({type: 'focusChange', payload: focusedInput})} 28 startDate={state.startDate} // Date or null 29 endDate={state.endDate} // Date or null 30 focusedInput={state.focusedInput} // START_DATE, END_DATE or null 31 /> 32 ) 33}
The following is a list of other OPTIONAL props you may provide to the DateRangeInput
to
customize appearance and behavior to your heart's desire.
1displayFormat?: string | FormatFunction // Default: 'MM/DD/YYYY' 2phrases?: DateRangeInputPhrases 3showStartDateCalendarIcon?: boolean // Default: true 4showEndDateCalendarIcon?: boolean // Default: true 5onClose?(): void 6vertical?: boolean // Default: false 7showResetDates?: boolean // Default: true 8showSelectedDates?: boolean // Default: true 9showClose?: boolean // Default: true 10rtl?: boolean // Default: false 11placement?: 'top' | 'bottom' // Default: bottom 12unavailableDates?: Date[] // Default: [] 13minBookingDate?: Date 14maxBookingDate?: Date 15numberOfMonths?: number // Default: 2 16minBookingDays?: number // Default: 1 17exactMinBookingDays?: boolean // Default: false 18firstDayOfWeek?: FirstDayOfWeek // Default: 1 19initialVisibleMonth?: Date 20isDateBlocked?(date: Date): boolean 21dayLabelFormat?(date: Date): string 22weekdayLabelFormat?(date: Date): string 23monthLabelFormat?(date: Date): string 24onDayRender?(date: Date): React.ReactNode 25startDateInputId?: string 26endDateInputId?: string
The Datepicker
is a fully controlled component that allows users to select a date range. You can
control the selected dates using the startDate
, endDate
, and onDatesChange
props as shown
below. Similarly, you can control which input is focused with the focusedInput
prop.
Here is the minimum REQUIRED setup you need to get the Datepicker
working:
IE11 is not supported
1import React, {useState} from 'react' 2import {Datepicker, START_DATE} from '@datepicker-react/styled' 3 4function App() { 5 const [state, setState] = useState({ 6 startDate: null, 7 endDate: null, 8 focusedInput: START_DATE, 9 }) 10 11 function handleDatesChange(data: OnDatesChangeProps) { 12 if (!data.focusedInput) { 13 setState({...data, focusedInput: START_DATE}) 14 } else { 15 setState(data) 16 } 17 } 18 19 return ( 20 <Datepicker 21 onDatesChange={handleDatesChange} 22 startDate={state.startDate} // Date or null 23 endDate={state.endDate} // Date or null 24 focusedInput={state.focusedInput} // START_DATE, END_DATE or null 25 /> 26 ) 27}
The following is a list of other OPTIONAL props you may provide to the Datepicker
to customize
appearance and behavior to your heart's desire.
1phrases?: DatepickerPhrases 2displayFormat?: string | FormatFunction // Default: 'MM/DD/YYYY' 3onClose?(): void 4showResetDates?: boolean // Default: true 5showSelectedDates?: boolean // Default: true 6showClose?: boolean // Default: true 7vertical?: boolean // Default: false 8rtl?: boolean // Default: false 9unavailableDates?: Date[] // Default: [] 10minBookingDate?: Date 11maxBookingDate?: Date 12numberOfMonths?: number // Default: 2 13minBookingDays?: number // Default: 1 14exactMinBookingDays?: boolean // Default: false 15firstDayOfWeek?: FirstDayOfWeek // Default: 0 16initialVisibleMonth?: Date 17isDateBlocked?(date: Date): boolean 18dayLabelFormat?(date: Date): string 19weekdayLabelFormat?(date: Date): string 20monthLabelFormat?(date: Date): string 21onDayRender?(date: Date): React.ReactNode
The DateSingleInput
is a fully controlled component that allows users to select a date. You can
control the selected date using the date
and onDateChange
props as shown below. Similarly, you
can control calendar visibility (the calendar is only visible if showDatepicker
is true
) with
the showDatepicker
and onFocusChange
props as shown below.
Here is the minimum REQUIRED setup you need to get the DateSingleInput
working:
IE11 is not supported
1import React, {useReducer} from 'react' 2import {DateSingleInput} from '@datepicker-react/styled' 3 4const initialState = { 5 date: null, 6 showDatepicker: false, 7} 8 9function reducer(state, action) { 10 switch (action.type) { 11 case 'focusChange': 12 return {...state, showDatepicker: action.payload} 13 case 'dateChange': 14 return action.payload 15 default: 16 throw new Error() 17 } 18} 19 20function App() { 21 const [state, dispatch] = useReducer(reducer, initialState) 22 23 return ( 24 <DateSingleInput 25 onDateChange={data => dispatch({type: 'dateChange', payload: data})} 26 onFocusChange={focusedInput => dispatch({type: 'focusChange', payload: focusedInput})} 27 date={state.date} // Date or null 28 showDatepicker={state.showDatepicker} // Boolean 29 /> 30 ) 31}
The following is a list of other OPTIONAL props you may provide to the DateSingleInput
to
customize appearance and behavior to your heart's desire.
1minBookingDate?: Date 2maxBookingDate?: Date 3numberOfMonths?: number 4firstDayOfWeek?: FirstDayOfWeek 5displayFormat?: string | FormatFunction 6phrases?: DateSingleInputPhrases 7showCalendarIcon?: boolean 8vertical?: boolean 9showResetDate?: boolean 10showClose?: boolean 11rtl?: boolean 12placement?: 'top' | 'bottom' 13unavailableDates?: Date[] // Default: [] 14initialVisibleMonth?: Date 15isDateBlocked?(date: Date): boolean 16onClose?(): void 17dayLabelFormat?(date: Date): string 18weekdayLabelFormat?(date: Date): string 19monthLabelFormat?(date: Date): string 20onDayRender?(date: Date): React.ReactNode 21inputId?: string
@datepicker-react/styled
supports theming with Styled components ThemeProvider
and
Styled System
theme-based style.
1<ThemeProvider 2 theme={{ 3 breakpoints: ['32em', '48em', '64em'], 4 reactDatepicker: { 5 daySize: [36, 40], 6 fontFamily: 'system-ui, -apple-system', 7 colors: { 8 accessibility: '#D80249', 9 selectedDay: '#f7518b', 10 selectedDayHover: '#F75D95', 11 primaryColor: '#d8366f', 12 }, 13 }, 14 }} 15> 16 ... 17</ThemeProvider>
Simple. Use React hooks (@datepicker-react/hooks).
Licensed under the MIT License, Copyright © 2019-present Miha Sedej.
See LICENSE for more information.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 4/11 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
144 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More