Open In App

Blaze UI Buttons

Blaze UI is a CSS open-source framework. It is a lightweight UI toolkit that provides great tools for building customized and scalable applications. It can work with any framework that exists. It can adapt to any ecosystem. All designs or CSS are mobile-first and hence responsive. Its project is available open-source so a large community maintains it.

Blaze UI Buttons provide beautiful buttons which are very customizable. We can have rounded buttons, button groups, and different sizes of buttons, including full-size buttons as well as ghost buttons. The buttons are the most important part of websites and blaze UI buttons are very useful.



Blaze UI Button Types:

Blaze UI Buttons Classes:



Syntax:

<button type="button" class="c-button 
                Blaze-UI-Buttons-Class">
    ...
</button>

Example 1: In the following example, we have a set of basic buttons of different colors that when clicked show alerts.




<!DOCTYPE html>
<html lang="en">
  
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content=
                "width=device-width, initial-scale=1.0" />
    <title> GeeksforGeeks | BlazeUI </title>
    <link rel="stylesheet" href=
  
    <script type="module" src=
    </script>
    <script nomodule="" src=
    </script>
    <script src=
    </script>
</head>
  
<body>
    <div class="o-container" style="padding: 1em;">
        <center>
            <div>
                <h1 style="color: green;">
                    GeeksforGeeks
                </h1>
            </div>
            <strong> Blaze UI Buttons </strong
            <br> <br>
  
            <div style="display: flex; justify-content: space-evenly;">
                <button onclick="showAlert('Default')" 
                        class="c-button u-xsmall">
                    Default
                </button>
                <button onclick="showAlert('Brand')" 
                        class="c-button c-button--brand u-small">
                    Brand
                </button>
                <button onclick="showAlert('Info')" 
                        class="c-button c-button--info u-small">
                    Info
                </button>
                <button onclick="showAlert('Warning')" 
                        class="c-button c-button--warning u-small">
                    Warning
                </button>
                <button onclick="showAlert('Success')" 
                        class="c-button c-button--success u-small">
                    Success
                </button>
                <button onclick="showAlert('Error')" 
                        class="c-button c-button--error u-small">
                    Error
                </button>
            </div>
        </center>
    </div>
    <script>
        const showAlert = (message) => {
            alert(`The colour of button is ${message} type.`)
        }
    </script>
</body>
  
</html>

Output:

Blaze UI Buttons

Example 2: In the following example, we have a ghost and rounded types of buttons.




<!DOCTYPE html>
<html lang="en">
  
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content=
                "width=device-width, initial-scale=1.0" />
    <title> GeeksforGeeks | BlazeUI </title>
    <link rel="stylesheet" href=
  
    <script type="module" src=
    </script>
    <script nomodule="" src=
    </script>
    <script src=
    </script>
</head>
  
<body>
    <div class="o-container" style="padding: 1em;">
        <center>
            <div>
                <h1 style="color: green;">
                    GeeksforGeeks
                </h1>
            </div>
            <strong> Blaze UI Buttons </strong>
            <br> <br>
  
            <div style="display: flex; justify-content: space-evenly;">
                <button onclick="showAlert('Default')" 
                        class="c-button c-button--rounded 
                               c-button--ghost u-xsmall">
                    Default
                </button>
  
                <button onclick="showAlert('Brand')"
                        class="c-button c-button--rounded 
                               c-button--ghost 
                               c-button--brand u-small">
                    Brand
                </button>
  
                <button onclick="showAlert('Info')"
                        class="c-button c-button--rounded 
                               c-button--ghost 
                               c-button--info u-small">
                    Info
                </button>
  
                <button onclick="showAlert('Warning')"
                        class="c-button c-button--rounded 
                               c-button--ghost 
                               c-button--warning u-small">
                    Warning
                </button>
  
                <button onclick="showAlert('Success')"
                        class="c-button c-button--rounded 
                               c-button--ghost 
                               c-button--success u-small">
                    Success
                </button>
  
                <button onclick="showAlert('Error')"
                        class="c-button c-button--rounded 
                               c-button--ghost 
                               c-button--error u-small">
                    Error
                </button>
            </div>
        </center>
    </div>
      
    <script>
        const showAlert = (message) => {
            alert(`The colour of button is ${message} type.`)
        }
    </script>
</body>
  
</html>

Output:

Blaze UI Buttons

Example 3: In the following example, we have button groups and we can toggle to have sharp or rounded corner buttons in the button group. The Button group has all buttons without any spacing in between.




<!DOCTYPE html>
<html lang="en">
  
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title> GeeksforGeeks | BlazeUI </title>
    <link rel="stylesheet" href=
  
    <script type="module" src=
    </script>
    <script nomodule="" src=
    </script>
    <script src=
    </script>
</head>
  
<body>
    <div class="o-container" style="padding: 1em;">
        <center>
            <div>
                <h1 style="color: green;">
                    GeeksforGeeks
                </h1>
            </div>
            <strong> Blaze UI Buttons </strong>
            <br /> <br />
  
            <button class="c-button c-button--warning" 
                    onclick="toggleRounded()">
                Toggle Rounded
            </button>
            <br /> <br />
  
            <span style="margin: auto; width: fit-content;" 
                  class="c-input-group">
                <button onclick="showAlert('Default')" 
                        class="c-button u-xsmall">
                    Default
                </button>
                <button onclick="showAlert('Brand')" 
                        class="c-button c-button--brand u-small">
                    Brand
                </button>
                <button onclick="showAlert('Info')" 
                        class="c-button c-button--info u-small">
                    Info
                </button>
                <button onclick="showAlert('Warning')" 
                        class="c-button c-button--warning u-small">
                    Warning
                </button>
                <button onclick="showAlert('Success')" 
                        class="c-button c-button--success u-small">
                    Success
                </button>
                <button onclick="showAlert('Error')" 
                        class="c-button c-button--error u-small">
                    Error
                </button>
            </span>
        </center>
    </div>
      
    <script>
        const toggleRounded = () => {
            $('span').toggleClass('c-input-group--rounded')
        }
        const showAlert = (message) => {
            alert(`The colour of button is ${message} type.`)
        }
    </script>
</body>
  
</html>

Output:

 

Example 4: In the following example, we have different widths of buttons with different colors which when clicked show an alert.




<!DOCTYPE html>
<html lang="en">
  
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content=
                "width=device-width, initial-scale=1.0" />
    <title> GeeksforGeeks | BlazeUI </title>
    <link rel="stylesheet" href=
  
    <script type="module" src=
    </script>
    <script nomodule="" src=
    </script>
    <script src=
    </script>
</head>
  
<body>
    <div class="o-container" style="padding: 1em;">
        <center>
            <div>
                <h1 style="color: green;">
                    GeeksforGeeks
                </h1>
            </div>
            <strong> Blaze UI Buttons </strong>
            <br /> <br />
  
            <div>
                <button onclick="showAlert('xsmall')" 
                        class="c-button c-button--brand u-xsmall">
                    xsmall
                </button>
                <button onclick="showAlert('small')" 
                        class="c-button c-button--info u-small">
                    small
                </button>
                <button onclick="showAlert('medium')" 
                        class="c-button c-button--warning u-medium">
                    medium
                </button>
                <button onclick="showAlert('large')" 
                        class="c-button c-button--success u-large">
                    large
                </button>
                <button onclick="showAlert('xlarge')" 
                        class="c-button c-button--error u-xlarge">
                    xlarge
                </button>
                <button onclick="showAlert('super')" 
                        class="c-button u-super">
                    super
                </button>
            </div>
        </center>
    </div>
      
    <script>
        const showAlert = (message) => {
            alert(`The size of button is ${message} type.`)
        }
    </script>
</body>
  
</html>

Output:

 

Example 5: In the following example, we have full-width buttons of different sizes. A full-width button takes the whole width of the screen.




<!DOCTYPE html>
<html lang="en">
  
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content=
                "width=device-width, initial-scale=1.0" />
    <title> GeeksforGeeks | BlazeUI </title>
    <link rel="stylesheet" href=
  
    <script type="module" src=
    </script>
    <script nomodule="" src=
    </script>
    <script src=
    </script>
</head>
  
<body>
    <div class="o-container" style="padding: 1em;">
        <center>
            <div>
                <h1 style="color: green;">
                    GeeksforGeeks
                </h1>
            </div>
            <strong> Blaze UI Buttons </strong>
            <br /> <br />
  
            <div>
                <button onclick="showAlert('xsmall')" 
                        class="c-button c-button--block 
                               c-button--brand u-xsmall">
                    xsmall
                </button>
  
                <button onclick="showAlert('small')" 
                        class="c-button c-button--block 
                               c-button--info u-small">
                    small
                </button>
  
                <button onclick="showAlert('medium')" 
                        class="c-button c-button--block 
                               c-button--warning u-medium">
                    medium
                </button>
  
                <button onclick="showAlert('large')" 
                        class="c-button c-button--block 
                               c-button--success u-large">
                    large
                </button>
  
                <button onclick="showAlert('xlarge')" 
                        class="c-button c-button--block 
                               c-button--error u-xlarge">
                    xlarge
                </button>
  
                <button onclick="showAlert('super')" 
                        class="c-button c-button--block 
                               u-super">
                    super
                </button>
            </div>
        </center>
    </div>
      
    <script>
        const showAlert = (message) => {
            alert(`The size of button is ${message} type.`)
        }
    </script>
</body>
  
</html>

Output:

 

Reference: https://www.blazeui.com/components/buttons


Article Tags :