Search...

DatePicker

React Bootstrap 5 DatePicker

React Bootstrap 5 Date picker allows you to pick a date and time with ease.

Importing the React Bootstrap 5 DatePicker Component

To use the Contrast React Bootstrap 5 DatePicker component, you import CDBDatePicker into your project.

js
import { CDBDatePicker } from "cdbreact";

Default DatePicker

Pro Component
,,,
Mon
Tue
Wed
Thu
Fri
Sat
Sun
js
import React from "react";
import { CDBDatePicker, CDBContainer } from "cdbreact";
const DatePicker = () => {
const [value, onChange] = useState(new Date());
return (
<CDBContainer>
<CDBDatePicker onChange={onChange} value={value} color="dark" />
</CDBContainer>
);
};
export default DatePicker;

Default Styles

You can customize CDBDatePickerwith our default colors styles

js
<CDBDatePicker onChange={onChange} value={value} color="primary" />
<CDBDatePicker onChange={onChange} value={value} color="secondary" />
<CDBDatePicker onChange={onChange} value={value} color="success" />
<CDBDatePicker onChange={onChange} value={value} color="danger" />
<CDBDatePicker onChange={onChange} value={value} color="dark" />
<CDBDatePicker onChange={onChange} value={value} color="warning" />
<CDBDatePicker onChange={onChange} value={value} color="info" />

API Reference: Contrast React Bootstrap 5 DatePicker Props

This section will build on your information about the props you get to use with the Contrast React Bootstrap 5 DatePicker component. You will find out what these props do, their default values, and how you would use them in your code.

The table below lists other prop 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 .../>

Build modern projects using Bootstrap 5 and Contrast

Trying to create components and pages for a web app or website from scratch while maintaining a modern User interface can be very tedious. This is why we created Contrast, to help drastically reduce the amount of time we spend doing that. so we can focus on building some other aspects of the project.

Contrast Bootstrap PRO consists of a Premium UI Kit Library featuring over 10000+ component variants. Which even comes bundled together with its own admin template comprising of 5 admin dashboards and 23+ additional admin and multipurpose pages for building almost any type of website or web app.
See a demo and learn more about Contrast Bootstrap Pro by clicking here.

ad-banner