React Suite Button <ButtonGroup> Props
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.
The ButtonGroup component is used to group the buttons together in a group.
React Suite ButtonGroups Props:
- size: This property of the ButtonGroup component is used to change the size of all buttons in the group. It accepts four values: xs, sm, md and lg.
- vertical: This attribute is used to specify whether we want to create a vertical layout of buttons or horizontal
- justified: This attribute creates a button with equal width
- block: Displays ButtonGroup as a block
- classPrefix: The prefix of the component CSS class
<ButtonGroup> <Button>Some Text</Button> </ButtonGroup>
Creating React Application And Installing Module:
Step 1: Create a React application using the following command:
npx create-react-app foldername
Step 2: After creating your project folder i.e. foldername, move to it using the following command:
Step 3: After creating the ReactJS application, Install the required module using the following command:
npm install rsuite
Project Structure: It will look like the following.
Example 1: Now write down the following code in the App.js file. Here, App is our default component where we have written our code. In this example, we will use props vertical to create vertical buttons.
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 will use props justified to create equal width buttons. We have also used IconButtons. We have taken icons from https://rsuitejs.com/resources/icons/