Open In App

Semantic-UI Form Loading State

Last Updated : 10 Mar, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

Semantic UI is an open-source framework that uses CSS and jQuery to build great user interfaces. It is same as a bootstrap for use and has great different elements to use to make your website look more amazing. It uses a class to add CSS to the elements.

A form is the section of a document that contains a number of input fields such as text field, password, and checkbox, etc. 

Semantic-UI form is used to create attractive form using semantic-ui classes. It is very easy to design attractive form. Semantic-UI Form Loading State is used to create a form and display the loading state indicator.

Semantic-UI Form Loading State Used Class:

  • loading: This class is used to display the loading indicator on the form element.

Syntax:

<div class="ui loading form">
    ...
</div>

Example 1: In this example, we will describe the Semantic-UI Form Loading State.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>
        Semantic-UI Form Loading State
    </title>

    <link rel="stylesheet" href=
"https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css" />
</head>

<body>
    <div class="ui container center aligned">
        <h2 style="color:green">
            GeeksforGeeks
        </h2>

        <h3>Semantic-UI Form Loading State</h3>
    </div>

    <form class="ui container loading form">
        <div class="field">
            <label>Username</label>
            <input type="text" name="username" 
                placeholder="Enter Username">
        </div>

        <div class="field">
            <label>Password</label>
            <input type="text" name="pwd" 
                placeholder="Enter Password">
        </div>

        <button class="ui button right" 
            type="submit">
            Submit
        </button>
    </form>
</body>

</html>

Output:

Example 2:  In this example, we will describe the Semantic-UI Form Loading State.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>
        Semantic-UI Form Loading State
    </title>

    <link href=
"https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"
        rel="stylesheet" />

    <script src="https://code.jquery.com/jquery-3.1.1.min.js"
        integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" 
        crossorigin="anonymous">
    </script>

    <script src=
"https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js">
    </script>
</head>

<body>
    <div class="ui container center aligned">
        <h2 style="color:green">
            GeeksforGeeks
        </h2>

        <h3>Semantic-UI Form Loading State</h3>
    </div>

    <form class="ui container loading form">
        <div class="field">
            <div class="three fields">
                <div class="field">
                    <label>First Name</label>
                    <input type="text" name="fname" 
                        placeholder="Enter First Name">
                </div>
                <div class="field">
                    <label>Second Name</label>
                    <input type="text" name="sname" 
                        placeholder="Enter Second Name">
                </div>
                <div class="field">
                    <label>Last Name</label>
                    <input type="text" name="lname"
                         placeholder="Enter Last Name">
                </div>
            </div>

            <div class="two fields">
                <div class="field">
                    <label>Email Id</label>
                    <input type="email" name="email" 
                        placeholder="Enter Email Id">
                </div>
                <div class="field">
                    <label>Mobile No</label>
                    <input type="number" name="number" 
                        placeholder="Enter Mobile No">
                </div>
            </div>

            <div class="field">
                <label>Short Notes</label>
                <textarea></textarea>
            </div>

            <div class="inline fields">
                <label for="gender">Male/Female:</label>
                <div class="field">
                    <div class="ui radio checkbox">
                        <input type="radio" name="gender" 
                            tabindex="0" class="hidden">
                        <label>Male</label>
                    </div>
                </div>
                <div class="field">
                    <div class="ui radio checkbox">
                        <input type="radio" name="gender" 
                            tabindex="0" class="hidden">
                        <label>Female</label>
                    </div>
                </div>
                <div class="field">
                    <div class="ui radio checkbox">
                        <input type="radio" name="gender" 
                            tabindex="0" class="hidden">
                        <label>Other</label>
                    </div>
                </div>
            </div>

            <button class="ui button right" type="submit">
                Submit
            </button>
        </div>
    </form>

    <script>
        $('.ui.radio.checkbox').checkbox();
    </script>
</body>

</html>

Output:

Reference: https://semantic-ui.com/collections/form.html#loading


Next Article

Similar Reads