Semantic-UI Button States

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 and jQuery to incorporate in different frameworks.

Semantic UI Button Group offers status of the button, if you want to create a like, subscribe and follow button in that case this kind of buttons is required.&

Semantic UI Button States Class:

  • active: This class is use to set the button status active.
  • disabled: This class is use to set the button status disabled.
  • loading: This class is use to set the button status loading.

Syntax:

<button class="ui "States-Class" button">...</button>

Below example will illustrate the Semantic-UI Button States:

Example:

HTML




<!DOCTYPE html>
<html>
<head>
    <title>Semantic UI</title>
    <link href=
"https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"
    rel="stylesheet" />
    <style>
        button {
            width: 150px;
        }
        .container {
            width: 600px;
            margin-left: 15%;
        }
    </style>
</head>
<body>
    <center>
        <h1 class="ui green">w3wiki</h1>
        <strong>Semantic UI Button States</strong>
    </center>
    <br><br>
    <div class="container">
        <strong>Conditionals:</strong>
        <button class="ui active button">
            <i class="like icon"></i>
        Like</button>
        <button class="ui disabled button">
            <i class="user icon"></i>
            Subscribed
        </button>
        <button class="ui secondary loading button">
            Loading
        </button>
    </div>
</body>
</html>


Output: