Open In App

React.js Blueprint Date picker Props

Blueprint is a React-based UI toolkit for the web. This library is very optimized and popular for building interfaces that are complex and data-dense for desktop applications. 

In this article, we’ll discuss React.js Blueprint Date picker Props. The DatePicker Component helps in choosing a single date.



Date Picker Props:

Syntax:



<DatePicker highlightCurrentDay showActionsBar ... />

Creating React Application And Installing Module:

Step 1: Create a React application using the following command:

npm create-react-app appname

Step 2: After creating your project folder i.e. appname, move to it using the following command:

cd appname

Step 3: After creating the ReactJS application, Install the required module using the following command:

npm install @blueprintjs/core
npm install @blueprintjs/datetime

Project Structure:

 

Example 1: Below example demonstrates the usage of highlightCurrentDay and showActionsBar props.




import React from "react";
import "@blueprintjs/datetime/lib/css/blueprint-datetime.css";
import "@blueprintjs/core/lib/css/blueprint.css";
import { DatePicker } from "@blueprintjs/datetime";
  
function App() {
    return (
        <div style={{
            padding: 20,
            textAlign: "center",
            color: "green"
        }}>
            <h1>ReactJS Blueprint Date Picker Props</h1>
            <div>
                <DatePicker showActionsBar highlightCurrentDay />
            </div>
        </div>
    );
}
  
export default App;

Output:

 

Example 2: Below example demonstrates the usage of shortcuts and footerElement props.




import React from "react";
import "@blueprintjs/datetime/lib/css/blueprint-datetime.css";
import "@blueprintjs/core/lib/css/blueprint.css";
import { Callout } from "@blueprintjs/core";
import { DatePicker } from "@blueprintjs/datetime";
  
const footerElement = 
    <Callout>Choose your date of Joining.</Callout>;
  
function App() {
    return (
        <div style={{
            padding: 20,
            textAlign: "center",
            color: "green"
        }}>
            <h1>ReactJS Blueprint Date Picker Props</h1>
            <div>
                <DatePicker
                    shortcuts
                    footerElement={footerElement}
                />
            </div>
        </div>
    );
}
  
export default App;

Output:

 

Reference: https://blueprintjs.com/docs/#datetime/datepicker.props-interface


Article Tags :