Open In App

React.js Blueprint Editable text Component Props

BlueprintJS is an open-source UI toolkit for React applications. It is used for making complex and data-heavy web applications. In this article, we will be discussing the Props of the Editable Text Component of the BluePrintJS library.

The Editable Text Component is similar to the Text component but it changes into an input field when it comes into focus. The Editable Text component inherits all the font styling from its ancestors.



React.js BluePrint Editable Text Component Properties:

Syntax:



<EditableText 
    multiline={true/false} 
    disabled={true/false}
    minLines={...} 
    maxLines={...}
    placeholder="..."
    intent="..."
    ...
/>

Creating React Application And Installing Modules:

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

npx create-react-app myApp

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

cd myApp

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

npm install @blueprintjs/core @blueprintjs/icons

Project Structure: After following the above steps, the project structure will look as below:

Project Structure

Example 1: Now write down the following code in the App.js file. This example shows the use of the above-listed props of the Editable Text component.




import React from 'react'
import '@blueprintjs/core/lib/css/blueprint.css';
import '@blueprintjs/icons/lib/css/blueprint-icons.css'
import { EditableText } from '@blueprintjs/core';
  
function App() {
    const divStyle = {
        display: 'block', width: 450,
        padding: 30
    };
      
    return (
        <div style={divStyle}>
            <h2
                style={{ color: "green" }}>
                GeeksforGeeks
            </h2>
            <h3>
                React.js BluePrint
                Editable Text Component Props
            </h3>
  
  
            <EditableText
                multiline={true}
                minLines={3}
                maxLines={12}
                intent="primary"
                placeholder="Edit the Paragraph..."
            />
        </div>
    );
}
  
export default App;

Steps to run the app: Execute the following command from your project folder to run the app.

npm start

Output:

 

Example 2: This is another example that shows the use of Editable Text Component props.




import React from 'react'
import '@blueprintjs/core/lib/css/blueprint.css';
import '@blueprintjs/icons/lib/css/blueprint-icons.css'
import { EditableText } from '@blueprintjs/core';
  
function App() {
    const divStyle = {
        display: 'block', width: 450,
        padding: 30
    };
      
    return (
        <div style={divStyle}>
            <h2
                style={{ color: "green" }}>
                GeeksforGeeks
            </h2>
            <h3>
                React.js BluePrint
                Editable Text Component Props
            </h3>
  
  
            <h2>
                <EditableText
                    multiline={false}
                    minLines={1}
                    intent="success"
                    placeholder="Edit the Heading..."
                />
            </h2>
  
            <h2>
                <EditableText
                    multiline={false}
                    minLines={1}
                    intent="danger"
                    disabled={true}
                    placeholder=
                    "Disabled Heading. Cannot be Edited"
                />
            </h2>
        </div>
    );
}
  
export default App;

Output:

 

Reference: https://blueprintjs.com/docs/#core/components/editable-text.props


Article Tags :