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.
import { CDBDatePicker } from "cdbreact";
Default DatePicker
Pro Componentimport 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 CDBDatePicker
with our default colors styles
<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.
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 .../> |
Trying to build out all user interfaces and components for your website or web app from scratch can become a very tedious task. A huge reason why we created Contrast Bootstrap to help 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 UI Kit featuring over 10000+ component variants. Together with a template of 5 admin dashboards and 23+ additional multipurpose pages template for building almost any type of website or web app. You can view a demo and learn more about Contrast by clicking here.Download the free react template

Contrast Bootstrap PRO was built using the most popular CSS framework Bootstrap to help build your next landing, admin SAAS, prelaunch etc project with a clean, prebuilt and well documented template and UI components.Learn more about Contrast