Get started with react-datepicker CDN
MIT licensed
React-datepicker is a popular React library for building custom date pickers.
Tags:- react
- datepicker
- calendar
- date
- react-component
Stable version
Copied!
How to start using react-datepicker CDN
import React from 'react';
import DatePicker from 'react-datepicker'; // Import the DatePicker component
import 'react-datepicker/dist/react-datepicker.css'; // Import the CSS for DatePicker
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
startDate: new Date(),
};
this.handleChange = this.handleChange.bind(this);
}
handleChange(date) {
this.setState({ startDate: date });
}
render() {
return (
<div>
<h1>Select a date:</h1>
<DatePicker
value={this.state.startDate}
onChange={this.handleChange}
/>
<p>You picked: {this.state.startDate.toLocaleDateString()}</p>
</div>
);
}
}
export default App;
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
All versions
0.10.0
0.11.0
0.11.1
0.11.2
0.11.3
0.11.4
0.11.5
0.12.0
0.13.0
0.14.0
0.14.1
0.14.2
0.14.3
0.14.4
0.14.5
0.15.0
0.15.1
0.15.2
0.16.1
0.17.0
0.18.0
0.19.0
0.20.0
0.21.0
0.22.0
0.23.0
0.23.1
0.23.2
0.24.0
0.25.0
0.26.0
0.27.0
0.28.0
0.28.1
0.28.2
0.29.0
0.30.0
0.32.0
0.33.0
0.34.0
0.37.0
0.39.0
0.40.0
0.41.0
0.41.1
0.43.0
0.44.0
0.46.0
0.47.0
0.48.0
0.49.0
0.50.0
0.51.0
0.52.0
0.53.0
0.54.0
0.55.0
0.56.0
0.57.0
0.58.0
0.59.0
0.6.0
0.6.1
0.6.2
0.60.0
0.60.2
0.61.0
0.62.0
0.63.0
0.64.0
0.7.0
0.8.0
0.9.0
1.0.0
1.0.1
1.0.2
1.0.3
1.0.4
1.1.0
1.2.1
1.2.2
1.3.0
1.4.0
1.4.1
1.5.0
1.6.0
1.7.0
1.8.0
2.0.0
2.1.0
2.10.0
2.10.1
2.11.0
2.12.0
2.12.1
2.13.0
2.14.0
2.14.1
2.15.0
2.16.0
2.2.0
2.3.0
2.4.0
2.5.0
2.6.0
2.7.0
2.8.0
2.9.3
2.9.4
2.9.6
3.0.0
3.1.3
3.2.2
3.3.0
3.4.0
3.4.1
3.5.0
3.6.0
3.7.0
3.8.0
4.0.0
4.1.0
4.1.1
4.10.0
4.10.1
4.11.0
4.12.0
4.13.0
4.14.0
4.14.1
4.15.0
4.16.0
4.17.0
4.18.0
4.19.0
4.2.0
4.2.1
4.20.0
4.21.0
4.23.0
4.24.0
4.25.0
4.3.0
4.4.0
4.5.0
4.6.0
4.7.0
4.8.0
4.9.0
5.0.0
5.1.0
6.0.0
6.1.0
6.2.0
6.3.0
6.4.0
6.5.0
6.6.0
6.7.0
6.7.1
6.8.0
6.9.0
7.0.0
7.1.0
7.2.0
*** 7.3.0