All Projects → flippingbitss → react-daterange-picker

flippingbitss / react-daterange-picker

Licence: MIT License
A react date range picker to using @material-ui. Live Demo: https://flippingbitss.github.io/react-daterange-picker/

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to react-daterange-picker

react-native-value-picker
Cross-Platform iOS(ish) style picker for react native.
Stars: ✭ 18 (-78.82%)
Mutual labels:  react-component, npm-package, picker, react-hooks
max-todos
A basic Todo app developed in React.
Stars: ✭ 19 (-77.65%)
Mutual labels:  hooks, material-ui, react-hooks
Vuetify Daterange Picker
The missing date range picker for Vuetify JS you have been looking for.
Stars: ✭ 192 (+125.88%)
Mutual labels:  date, picker, daterange
imrc-datetime-picker
(Improved) React component datetime picker by momentjs 📆
Stars: ✭ 21 (-75.29%)
Mutual labels:  date, npm-package, picker
Chocobo-Date-Range-Picker
🗓️ Component - The Date Range Picker easier to use in AngularJS.
Stars: ✭ 23 (-72.94%)
Mutual labels:  date, picker, daterange
Lightpick
(deprecated) Check out the new date picker Litepicker
Stars: ✭ 204 (+140%)
Mutual labels:  date, picker, daterange
React Colorful
🎨 A tiny (2,5 KB) color picker component for React and Preact apps
Stars: ✭ 951 (+1018.82%)
Mutual labels:  hooks, react-component, picker
vue-daterangepicker-component
Date range picker for Vue 1.x, based on bootstrap-daterangepicker
Stars: ✭ 22 (-74.12%)
Mutual labels:  date, picker, daterange
react-fusionui
☢️ Nuclear power-up for your UI.
Stars: ✭ 13 (-84.71%)
Mutual labels:  hooks, react-component
use-app-state
🌏 useAppState() hook. that global version of setState() built on Context.
Stars: ✭ 65 (-23.53%)
Mutual labels:  hooks, react-hooks
reason-hooks-lib
A set of reusable ReasonReact hooks.
Stars: ✭ 31 (-63.53%)
Mutual labels:  hooks, react-hooks
react-windows-ui
Build Windows fluent UI apps using ReactJS. Provides a set of accessible, reusable, and composable React components that make it super easy to create websites and apps.
Stars: ✭ 383 (+350.59%)
Mutual labels:  react-component, npm-package
react-cool-form
😎 📋 React hooks for forms state and validation, less code more performant.
Stars: ✭ 246 (+189.41%)
Mutual labels:  hooks, react-hooks
react-native-daterange-picker
A React Native component for picking date ranges or single dates.
Stars: ✭ 86 (+1.18%)
Mutual labels:  daterange, daterange-picker
react-picky-date-time
A react component for date time picker. Online demo examples
Stars: ✭ 41 (-51.76%)
Mutual labels:  date, picker
use-query-string
🆙 A React hook that serializes state into the URL query string
Stars: ✭ 50 (-41.18%)
Mutual labels:  hooks, react-hooks
resynced
An experimental hook that lets you have multiple components using multiple synced states using no context provider
Stars: ✭ 19 (-77.65%)
Mutual labels:  hooks, react-hooks
jedisdb
redis like key-value state management solution for React
Stars: ✭ 13 (-84.71%)
Mutual labels:  hooks, react-hooks
tacklebox
🎣React UX components for handling common interactions
Stars: ✭ 15 (-82.35%)
Mutual labels:  hooks, react-hooks
use-detect-print
A react hook to detect when a page is being printed
Stars: ✭ 55 (-35.29%)
Mutual labels:  hooks, react-hooks

react-daterange-picker

A react date range picker using material-ui components.

Latest npm version

Live Demo: https://flippingbitss.github.io/react-daterange-picker/

Usage

npm install @matharumanpreet00/react-daterange-picker --save
# or with yarn
yarn add @matharumanpreet00/react-daterange-picker

Screenshot

Basic Example

import React from "react";
import { DateRangePicker, DateRange } from "@matharumanpreet00/react-daterange-picker";

type Props = {}
type State = {
    open: boolean,
    dateRange: DateRange
}

class App extends React.Component<Props, State> {
	state = {
		open: true,
		dateRange: {}
	};
	
	render() {
		return (
			<DateRangePicker
				open={this.state.open}
				onChange={range => this.setState({ dateRange: range })}
			/>
		);
	}
}

export default App;

Basic example using hooks

import React from "react";
import { DateRangePicker, DateRange } from "@matharumanpreet00/react-daterange-picker";

type Props = {}

const App: React.FunctionComponent<Props> = props => {
	const [open, setOpen] = React.useState(false);
	const [dateRange, setDateRange] = React.useState<DateRange>({});

	return (
		<DateRangePicker
			open={open}
			onChange={range => setDateRange(range)}
		/>
	);
}

export default App;

Types

interface DateRange {
    startDate?: Date,
    endDate?: Date
}

interface DefinedRange {
    label: string,
    startDate: Date,
    endDate: Date
}

Props

Name Type Required Default value Description
initialDateRange DateRange {} initially selected date range
minDate `Date string` 10 years ago
maxDate `Date string` 10 years from now
onChange (DateRange) => void required - handler function for providing selected date range
definedRanges DefinedRange[] - custom defined ranges to show in the list
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].