React Suite Button Disabled
React Suite is a popular front-end library with a set of React components that are designed for the middle platform and back-end products. The Button component is used to fire an action when the user clicks the button. In this article, we will be seeing React Suite Button Disabled.
The disabled property of the Button component is used to disable the Button. Disabled buttons are used when we do not want the user to click the button.
React Suite Button Disabled Components:
- Button: This is the most basic component used to create a button.
React Suite Button Disabled Props:
- disabled: It is a boolean property used to disable the Button.
- color: This property of the Button component is used to change the color of the button. The color property can have any one of seven values: red, orange, yellow, green, cyan, blue, or violet.
<Button disabled>Disabled Button</Button>
Creating React Application And Installing Module:
- Step 1: Create a React application using the following command:
npx create-react-app foldername
- Step 2: Move to the newly created project folder using the following command:
- Step 3: After creating the ReactJS application, Install the required module ( rsuite in this case ) using the following command:
npm install rsuite
Project Structure: After completing the above steps, the project structure will look like the following:
Example 1: In the following example, we used the disabled property of the Button component to disable the button.
Step to Run Application: Run the application using the following command from the root directory of the project:
Output: Now open your browser and go to http://localhost:3000/, you will see the following output:
Example 2: In this example, we used the color property of the Button component along with the disabled property to change the color of the disabled button.