DatePicker

DatePicker

Date picker is a plugin that adds the function of selecting time without the necessity of using custom JavaScript code.

Examples

Pro Component

Default 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.

NameTypeDefaultDescriptionExample
classNameStringAdds custom classesAdds custom classes<CDBDatePicker className="myClass" ... />
tagStringdivChanges default input tag<CDBDatePicker tag="input" ... />
disableBooleanfalseDisables DatePicker component<CDBDatePicker disabled .../>