DatePicker
DatePicker
Date picker is a plugin that adds the function of selecting time without the necessity of using custom JavaScript code.
Examples
Pro ComponentDefault DatePicker example.

import React from "react";import { CDBDatePicker, CDBContainer } from "cdbreact";const DatePicker = () => {const [value, onChange] = useState(new Date());return (<CDBContainer><CDBDatePicker onChange={onChange} value={value} /></CDBContainer>);};export default DatePicker;
API
In this section you will find advanced information about the DatePicker component. You will find out which modules are required, what are the possibilities of configuring the component, and what events and methods you can use to work with it.
Contrast DatePicker Import Statement
You need to import the Contrast DatePicker component first before using it.
import { CDBDatePicker } from "cdbreact";
API Reference: Contrast DatePicker Properties
The table below shows the configuration options of the CDBDatePicker component.
| Name | Type | Default | Description | Example |
|---|---|---|---|---|
| className | String | Adds custom classes | Adds custom classes | <CDBDatePicker className="myClass" ... /> |
| tag | String | div | Changes default input tag | <CDBDatePicker tag="input" ... /> |
| disable | Boolean | false | Disables DatePicker component | <CDBDatePicker disabled .../> |