ReactJS Semantic UI Label Element
Semantic UI is a modern framework used in developing seamless designs for the website, It gives the user a lightweight experience with its components. It uses the predefined CSS, JQuery language to incorporate in different frameworks.
In this article we will know how to use label elements in ReactJS Semantic UI. Label element is used to display content classification
- Pointing: We can make label that points to content by using pointing property.
- Prompt: We can make label that prompt for errors in form by using this property.
- Corner: We can make label that position itself in the corner by using this property.
- Tag: This property can make label that appear as a tag.
- Ribbon: We can make label that appear as a ribbon using this property.
- Attached:We can make label that is attached.
- Horizontal: We can make a horizontal label by using horizontal property.
- Floating: This property can make label to float on another element.
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: Install semantic UI in your given directory.
npm install semantic-ui-react semantic-ui-css
Project Structure: It will look like the following.
Step to Run Application: Run the application from the root directory of the project, using the following command.
Example 1: In this example we will be going to use label and icon elements to display basic label by using ReactJS Semantic UI Label element.
Example 2: In this example we will be going to use label and icon elements to display disabled label by using ReactJS Semantic UI Label element.