Skip to content
Related Articles
Open in App
Not now

Related Articles

Semantic-UI Search Aligned Variation

Improve Article
Save Article
Like Article
  • Last Updated : 24 Feb, 2022
Improve Article
Save Article
Like Article

Semantic UI open-source framework gives icons or glyphs that are used to show pictures related to some elements using CSS and jQuery that is used to create great user interfaces. It is a development framework used to create beautiful and responsive layouts.

Semantic UI Search is used to allow the user to search different things on the website. The search can help to search blogs, tools, other links, etc.

Semantic UI Search Aligned Variation sets the direction of the results where they will be displayed. The results can either be displayed on left by default or right direction.

Semantic UI Search Aligned Variation Classes:

  • left aligned: The search results are displayed in the left direction.
  • right aligned: The search results are displayed in the right direction.

Syntax: Add either left or right aligned class to the search element to change the direction of search results as follows:

<div class="ui right aligned search">

Example: In the following example, we have a button to change the direction of the search results using the alignment variation.


<!DOCTYPE html>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content=
        "width=device-width, initial-scale=1.0" />
    <link href=
        rel="stylesheet" />
    <script src=""></script>
    <script src=
    <div class="ui container">
            <div class="ui header green">
                Semantic UI Search Aligned Variation
        <div class="ui segment">
            <h1>Welcome to GeeksforGeeks</h1>
            <p>Find the best programming tutorials here.</p>
            <button class="ui button" onclick="changeAlignment()">
                Change Alignment
            <div class="ui right aligned search">
                <div class="ui icon input">
                    <input class="prompt" type="text" 
                        placeholder="Search tutorials..." />
                    <i class="search icon"></i>
                <div class="results"></div>
        const changeAlignment = () => {
            $('').toggleClass('left aligned')
                .toggleClass('right aligned')
        var tutorials = [
            { title: 'Data Structures' },
            { title: 'Algorithms' },
            { title: 'Machine Learning' },
            { title: 'Web Development' },
            { title: 'Competitive Programming' },
            { title: 'Java' },
            { title: 'C' },
            { title: 'C#' },
            { title: 'C++' },
            source: tutorials,



My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!