ReactJS Evergreen Button Component
Last Updated :
05 Jun, 2021
React Evergreen is a popular front-end library with a set of React components for building beautiful products as this library is flexible, sensible defaults, and User friendly. Button Component allows the user to take actions, and make choices, with a single tap. We can use the following approach in ReactJS to use the Evergreen Button Component.
Button Props:
- appearance: It is used to denote the appearance of the button.
- size: It is used to denote the size of the button.
- isLoading: It is used to show a loading spinner before the children when this is set to true.
- isActive: It is used to forcefully set the active state of a button.
- iconBefore: It is used to set an icon before the text.
- iconAfter: It is used to set an icon after the text.
- disabled: It is used to disable the button when this is set to true.
- className: It is used to pass the class name for the button.
IconButton Props:
- size: It is used to denote the size of the button.
- icon: It is used to denote the custom icon node or an Evergreen icon.
- iconsize: It is used to denote the icon size.
- intent: It is used to denote the intent of the button.
- appearance: It is used to denote the appearance of the button.
- isActive: It is used to forcefully set the active state of a button.
- disabled: It is used to disable the button when this is set to true.
- className: It is used to pass the class name for the button.
TextDropdownButton Props:
- isActive: It is used to forcefully set the active state of a button.
- disabled: It is used to disable the button when this is set to true.
- icon: It is used to denote the custom icon node or an Evergreen icon.
- className: It is used to pass the class name for the button.
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:
cd foldername
Step 3: After creating the ReactJS application, Install the required module using the following command:
npm install evergreen-ui
Project Structure: It will look like the following.
Project StructureExample: Now write down the following code in the App.js file. Here, App is our default component where we have written our code.
App.js
import React from 'react'
import { Button } from 'evergreen-ui'
export default function App() {
return (
<div style={{
display: 'block', width: 700, paddingLeft: 30
}}>
<h4>ReactJS Evergreen Button Component</h4>
<Button appearance="primary">
Primary Button
</Button>
<br></br>
<Button appearance="minimal">
Minimal Button
</Button>
<br></br>
<Button>Default Button</Button>
</div>
);
}
Step to Run Application: Run the application using the following command from the root directory of the project:
npm start
Output: Now open your browser and go to http://localhost:3000/, you will see the following output:

Reference: https://evergreen.segment.com/components/buttons
Similar Reads
ReactJS Evergreen Alert Component React Evergreen is a popular front-end library with a set of React components for building beautiful products as this library is flexible, sensible defaults, and User friendly. Alert Component is used for are urgent interruptions, requiring acknowledgment, that informs the user about a situation. We
2 min read
ReactJS Evergreen Checkbox Component React Evergreen is a popular front-end library with a set of React components for building beautiful products as this library is flexible, sensible defaults, and User friendly. Checkbox component allows the user to make a binary choice from the given options. We can use the following approach in Rea
2 min read
ReactJS Evergreen Combobox Component React Evergreen is a popular front-end library with a set of React components for building beautiful products as this library is flexible, sensible defaults, and User friendly. Combobox Component allows the user to select an option from a predefined list of options. We can use the following approach
2 min read
ReactJS Evergreen Avatar Component React Evergreen is a popular front-end library with a set of React components for building beautiful products as this library is flexible, sensible defaults, and User friendly. Avatar components are used to represent users only. We can use the following approach in ReactJS to use the Evergreen Avata
2 min read
ReactJS Evergreen Tab Component React Evergreen is a popular front-end library with a set of React components for building beautiful products as this library is flexible, sensible defaults, and User friendly. Tab Component allows the user to switch between components present in given different tabs. It is used for organizing our c
2 min read