### Install and Run DocPad Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/README.md Installs the necessary Node.js version, DocPad globally, and then installs project dependencies and starts the development server. ```bash nvm install 8 nvm use 8 npm install -g docpad@6.79.4 docpad install; docpad run ``` -------------------------------- ### Semantic UI Progress Component Examples Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/progress.html This snippet demonstrates various ways to initialize and control the Semantic UI progress component. It includes examples for basic progress, progress with custom text, file upload progress, and dynamic updates. ```javascript $(document) .ready(function() { $('.attached.progress.demo') .progress({ label : false, value : Math.floor(Math.random() * 5) + 1 }); $('.basic.progress.demo') .progress({ label : false, value : Math.floor(Math.random() * 5) + 1, text : { active : '{percent}% Complete', success : 'Done!' } }); $('.indicating.progress.demo') .progress({ label : true, total : 10, value : Math.floor(Math.random() * 5) + 1, text : { active : '{percent}% Done', success : 'Completed!' } }); $('.file.progress.demo') .progress({ label: false, text: { active : 'Uploading {value} of {total}', success : '{total} Files Uploaded!' } }); var progress = function() { $('.demo.progress').progress('increment'); setTimeout(progress, (Math.random() * 2000) + 300); }; setTimeout(progress, 1000); setInterval(function() { $('.demo.progress').progress('reset'); }, 30000); }); ``` -------------------------------- ### Semantic UI Grid Simple Examples Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/grid.html Presents simple grid examples in Semantic UI. This styling ensures basic column separation with a minimum height for columns that are not rows or nested grids. ```css .demo .grid.simple.examples .grid .column:not(.row):not(.grid):after { content: ""; display: block; min-height: 50px; } ``` -------------------------------- ### Selection Dropdown Example Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/form.html Demonstrates the basic structure and usage of a selection dropdown component in Semantic UI. ```html ``` -------------------------------- ### Input Fields and Labels Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/form.html Shows examples of various input fields including required, disabled, and password inputs, along with their associated labels. ```html
``` -------------------------------- ### Semantic UI Button State Management Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/button.html Demonstrates how to manage the state of a follow button using Semantic UI's state module. This includes setting initial text and updating it based on user interaction. ```javascript $('.button.demo .follow') .state({ text: { inactive : 'Follow', active : 'Following' } }); ``` -------------------------------- ### Semantic UI Grid Shaded Examples Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/grid.html Demonstrates shaded grid examples in Semantic UI. It styles rows and columns to have a shaded appearance, with pseudo-elements used for visual separation. ```css .demo .grid.shaded.examples .row { position: relative; } .demo .grid.shaded.examples .grid > .column { position: relative; z-index: 11; } .demo .grid.shaded.examples .grid .column:not(.row):after { background-color: #AAAAAA; content: ""; display: block; min-height: 1em; } ``` -------------------------------- ### Initialize Accordion Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/accordion.html Initializes the accordion component on elements with the class 'ui accordion' within elements having the class 'example' inside 'demo' containers. This is a common pattern for applying Semantic UI components. ```javascript $(document) .ready(function(){ $('.demo .example .ui.accordion') .accordion() ; }) ; ``` -------------------------------- ### Semantic UI Grid Divided Examples Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/grid.html Shows divided grid examples in Semantic UI. This styling adds a visual divider between columns using pseudo-elements with a semi-transparent background color. ```css .demo .grid.divided.examples .grid .column:not(.row):after { background-color: rgba(0, 0, 0, 0.1); content: ""; display: block; min-height: 1em; } ``` -------------------------------- ### Informational Message Example Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/message.html Displays an informational message, typically used for providing context or guidance to the user. It uses the 'info' color scheme. ```html
Info Message

Example description

``` -------------------------------- ### Semantic UI Grid Nested Examples Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/grid.html Illustrates nested grid examples in Semantic UI. This styling applies a subtle border to inner grids and uses pseudo-elements for column separation within nested structures. ```css .demo .grid.nested.examples .grid .grid { box-shadow: 0px 0px 0px 1px #F0F0F0 inset; } .demo .grid.nested.examples .grid .grid .column:after { background-color: #AAAAAA; content: ""; display: block; min-height: 1em; } ``` -------------------------------- ### Initialize Default Rating Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/rating.html Initializes the Semantic UI Rating component with its default settings. This is typically used for basic star rating functionality. ```javascript $(document) \ .ready(function() { \ $('.rating.demos .items .ui.rating') \ .rating() \ ; \ }) ``` -------------------------------- ### Warning Message Example Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/message.html Displays a warning message, alerting the user to potential issues or important considerations. It uses the 'warning' color scheme. ```html
Warning Message
``` -------------------------------- ### List Message Example Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/message.html Shows a message component containing an unordered list. This is useful for displaying multiple related items or points within a message. ```html
List Message
``` -------------------------------- ### HTML Structure for Popups Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/popup.html Provides the HTML structure for various popup examples, including basic popups, small and large variations, and inverted popups. This serves as the content that the JavaScript popup component will attach to. ```html ``` -------------------------------- ### Attached Message Example Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/message.html Illustrates how messages can be attached to the top or bottom of other elements, creating a contiguous visual block. ```html
Top attached
Content segment
Bottom attached
``` -------------------------------- ### Semantic UI Grid Animation Styling Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/grid.html Applies animation-related styling to Semantic UI grid examples. It resets margins and paddings for the grid container to ensure smooth animations. ```css .demo .grid.examples { margin: 0em !important; padding: 0em !important; } ``` -------------------------------- ### Closable Message Example Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/message.html Demonstrates a closable message component in Semantic UI. When the close icon is clicked, the message animates out using a 'scale out' transition. ```javascript $(document) .ready(function(){ $(".example .message .close") .on("click", function() { $(this).closest(".message").transition("scale out"); }) ; }) ; ``` ```html
This is a closable message.
``` -------------------------------- ### Negative Message Example Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/message.html Indicates an error or negative outcome. It uses the 'negative' color scheme, typically associated with red. ```html
Negative Message

Example description

``` -------------------------------- ### Positive Message Example Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/message.html Represents a positive outcome or success message. It uses the 'positive' color scheme, often associated with green. ```html
Positive Message

Example description

``` -------------------------------- ### Multiple Inline Fields Example Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/form.html Shows how to arrange multiple input fields horizontally using inline styling. ```html
``` -------------------------------- ### Wireframe Image Placeholder Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/feed.html Represents a placeholder for an image within a wireframe layout. This is a common UI element used during the design phase. ```html Wireframe Square Image ``` -------------------------------- ### Initialize Clearable Rating Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/rating.html Initializes the Semantic UI Rating component with the 'clearable' option enabled, allowing users to reset their rating selection. ```javascript $(document) \ .ready(function() { \ $('.rating.demos .list .ui.rating') \ .rating({ clearable: true }) \ ; \ }) ``` -------------------------------- ### Semantic UI Shape Animation Control Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/shape.html This JavaScript code snippet demonstrates how to initialize and control Semantic UI's shape component. It includes event handling for buttons that trigger different rotation animations and directions on the shape. The code relies on jQuery and Semantic UI libraries. ```javascript $(document) .ready(function() { var $demo = $('.shape.demos .ui.shape'), $directionButton = $('.shape.demos .direction .button'), handler ; // event handlers handler = { rotate: function() { var $shape = $(this).closest('.buttons').prevAll('.ui.shape').eq(0), direction = $(this).data('direction') || false, animation = $(this).data('animation') || false; if(direction && animation) { $shape.shape(animation + '.' + direction); } } }; // attach events $demo.shape(); $directionButton.on('click', handler.rotate).popup({ position : 'bottom center' }); }); ``` -------------------------------- ### Generate and Serve Semantic UI Docs Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/README.md Steps to generate Semantic UI documentation by building the UI and then running the DocPad server. It also includes an option to watch for UI changes. ```bash # Clone both repos to respective folders # npm install in both directories # Go through Semantic UI installer steps (auto) # In ./ui folder `gulp build-docs` (builds files to ./docs) # In ./docs folder `docpad install` then `docpad run` # Go to http://localhost:9778/ docs should be there # Optionally run `gulp serve-docs` in ./ui to serve any changes from ./ui/src to ./docs ``` -------------------------------- ### Publish to GitHub Pages Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/README.md Command to automatically deploy the generated documentation to GitHub Pages. ```bash docpad deploy-ghpages --env static ``` -------------------------------- ### Technology Stack Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/raw/humans.txt Lists the core technologies used in the project, including markup, styling, and scripting languages. ```text HTML5, CSS3 jQuery ``` -------------------------------- ### Semantic UI Initialization Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/card.html Initializes Semantic UI components such as ratings and dimmers on document ready. It targets elements with specific classes to apply interactive behaviors. ```javascript $(document) .ready(function(){ $('.demo .star.rating') .rating() ; $('.demo .card .dimmer') .dimmer({ on: 'hover' }) ; }); ``` -------------------------------- ### Semantic UI Modal Initialization and Event Handling Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/modal.html This JavaScript code demonstrates how to initialize and manage Semantic UI modals. It shows how to attach modals to specific buttons for triggering, including standard, basic, and full-screen modal types. It relies on jQuery and Semantic UI's modal module. ```javascript $(document) \ .ready(function() { \ $('.demo.modal') \ .modal() \ ; \ $('.standard.demo.modal') \ .modal('attach events', '.standard.demo.button') \ ; \ $('.basic.demo.modal') \ .modal('attach events', '.minimal.demo.button') \ ; \ $('.fullscreen.demo.modal') \ .modal('attach events', '.fullscreen.demo.button') \ ; \ }) ``` -------------------------------- ### Semantic UI Transition Animations Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/transition.html This code demonstrates how to apply various CSS transition animations from Semantic UI to an element when a button is clicked. It listens for clicks on buttons within a '.transition.demo' container and applies the corresponding animation to elements with the class '.transition.demo .image'. ```javascript $(document) \ .ready(function(){ \ $('.transition.demo .button') \ .on('click', function() { \ var animation = $(this).text(); \ if(typeof animation == 'string') { \ animation = animation.toLowerCase(); \ } \ $('.transition.demo .image') \ .transition({ animation: animation, interval: 200 }) \ ; \ }) \ ; \ }) \ ; ``` ```css .transition.demo .button { margin-bottom: 0.5em; } \ /* Dont hide on hide */ \ .transition.demo .ui.hidden.image { display: inline-block !important; } ``` -------------------------------- ### Toggle and Option Fields Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/form.html Demonstrates the implementation of toggle switches and grouped option fields. ```html
``` -------------------------------- ### Basic Popup Initialization Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/popup.html Initializes the popup component on elements with the class 'popup'. This is the most basic usage, applying default popup behavior. ```javascript $(document).ready(function() { $('.popup.demos .position .icon').popup(); $('.popup.demos .avatar').popup(); $('.popup.demos .button').popup(); }); ``` -------------------------------- ### Advanced Popup Configuration Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/popup.html Demonstrates an advanced popup configuration with specific settings for inline display, hoverable behavior, positioning, and show/hide delays. This is useful for creating more interactive and customized tooltips. ```javascript $(document).ready(function() { $('.popup.demos .menu .browse').popup({ inline: true, hoverable: true, position: 'bottom left', delay: { show: 300, hide: 800 } }); }); ``` -------------------------------- ### Form with Messages Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/form.html Shows how to structure a form with submit buttons and display warning or error messages with descriptions. ```html
You must fill out this form completely
There was an error
Error message long description
``` -------------------------------- ### Semantic UI Tab Initialization Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/tab.html Initializes Semantic UI tabs with history and context support. This is useful for creating navigable tabbed interfaces. ```javascript $(document) .ready(function(){ $('.tab.demo .menu .item') .tab({ history: true, context: $('.tab.demo') }) ; }); ``` -------------------------------- ### Initialize Semantic UI Checkboxes Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/checkbox.html Initializes all elements with the class 'ui.checkbox' within the '.demo' container using Semantic UI's checkbox behavior. This is a common pattern for activating interactive elements on a page. ```javascript $(document) .ready(function(){ $('.demo .ui.checkbox') .checkbox() ; }) ; ``` -------------------------------- ### Checkbox and Inline Fields Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/form.html Demonstrates the usage of a checkbox and how to arrange multiple input fields inline. ```html
``` -------------------------------- ### Dropdown and Menu Initialization Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/dropdown.html Initializes Semantic UI dropdowns and hoverable menus using jQuery. This code targets elements with specific classes to enable their interactive behavior. ```javascript $(document) .ready(function(){ $('.demo .ui.dropdown') .dropdown() ; $('.demo .ui.menu .dropdown') .dropdown({ on: 'hover' }) ; }) ``` -------------------------------- ### Semantic UI Dropdown Initialization Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/documents/hotfix.html Initializes a Semantic UI dropdown component with hover activation, clearable option, and a drop transition. This code requires the Semantic UI JavaScript library. ```javascript $(document).ready(function() { $('.ui.dropdown').dropdown({ transition: 'drop', on: 'hover', clearable: true }); }); ``` -------------------------------- ### Semantic UI Search with Local Data Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/search.html Initializes the Semantic UI search component using a predefined local array of content objects. This is suitable for smaller datasets or when data is readily available client-side. ```javascript var content = [ { title: 'French Territories' }, { title: 'Togs' }, { title: 'Thailans' }, { title: 'Tajikistas' }, { title: 'Tokelas' }, { title: 'Timorlests' }, { title: 'Turkmenistas' }, { title: 'Tunisis' }, { title: 'Tongs' }, { title: 'Turkes' }, { title: 'Trinidas' }, { title: 'Tuvals' }, { title: 'Taiwas' }, { title: 'Tanzanis' }, { title: 'Ukrains' }, { title: 'Ugands' }, { title: 'Us Minor Islands' }, { title: 'United States' }, { title: 'Uruguas' }, { title: 'Uzbekistas' }, { title: 'Vatican Cits' }, { title: 'Saint Vincens' }, { title: 'Venezuels' }, { title: 'British Virgin Islands' }, { title: 'Us Virgin Islands' }, { title: 'Vietnas' }, { title: 'Vanuats' }, { title: 'Wallis and Futuns' }, { title: 'Samos' }, { title: 'Yemes' }, { title: 'Mayotts' }, { title: 'South Africs' }, { title: 'Zambis' }, { title: 'Zimbabws' } ]; $('.search.demo .local').search({ source: content }); ``` -------------------------------- ### Semantic UI Dimmable Section Initialization Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/dimmer.html Initializes the Semantic UI dimmer component on a page dimmer element. This sets up the basic functionality for dimming the entire page. ```javascript $(document).ready(function() { // selector cache var $pageDimmer = $('.demo.page.dimmer'); // Initializes the dimmer on the page dimmer element $pageDimmer.dimmer(); }); ``` -------------------------------- ### Radio Button Selection Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/form.html Illustrates how to implement radio button groups for single selection from multiple options, including inline variations. ```html
``` -------------------------------- ### Basic robots.txt Configuration Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/raw/robots.txt A standard robots.txt file that disallows all user-agents from crawling any part of the website. ```robots.txt User-agent: * Disallow: / ``` -------------------------------- ### Initialize Country Data List Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/search.html This code snippet demonstrates how to initialize an array of objects, where each object represents a country with a 'title' property. This data is typically used to populate UI elements like dropdowns or search fields. ```javascript $(document).ready(function() { var content = [ { title: 'Andorrs' }, { title: 'United Arab Emirates' }, { title: 'Afghanistas' }, { title: 'Antigus' }, { title: 'Anguills' }, { title: 'Albanis' }, { title: 'Armenis' }, { title: 'Netherlands Antilles' }, { title: 'Angols' }, { title: 'Argentins' }, { title: 'American Samos' }, { title: 'Austris' }, { title: 'Australis' }, { title: 'Arubs' }, { title: 'Aland Islands' }, { title: 'Azerbaijas' }, { title: 'Bosnis' }, { title: 'Barbados' }, { title: 'Bangladess' }, { title: 'Belgius' }, { title: 'Burkina Fass' }, { title: 'Bulgaris' }, { title: 'Bahrais' }, { title: 'Burunds' }, { title: 'Benis' }, { title: 'Bermuds' }, { title: 'Brunes' }, { title: 'Bolivis' }, { title: 'Brazis' }, { title: 'Bahamas' }, { title: 'Bhutas' }, { title: 'Bouvet Islans' }, { title: 'Botswans' }, { title: 'Belarus' }, { title: 'Belizs' }, { title: 'Canads' }, { title: 'Cocos Islands' }, { title: 'Congs' }, { title: 'Central African Republis' }, { title: 'Congo Brazzavills' }, { title: 'Switzerlans' }, { title: 'Cote Divoirs' }, { title: 'Cook Islands' }, { title: 'Chils' }, { title: 'Cameroos' }, { title: 'Chins' }, { title: 'Colombis' }, { title: 'Costa Rics' }, { title: 'Serbis' }, { title: 'Cubs' }, { title: 'Cape Verds' }, { title: 'Christmas Islans' }, { title: 'Cyprus' }, { title: 'Czech Republis' }, { title: 'Germans' }, { title: 'Djibouts' }, { title: 'Denmars' }, { title: 'Dominics' }, { title: 'Dominican Republis' }, { title: 'Algeris' }, { title: 'Ecuados' }, { title: 'Estonis' }, { title: 'Egyps' }, { title: 'Western Sahars' }, { title: 'Eritres' }, { title: 'Spais' }, { title: 'Ethiopis' }, { title: 'European Unios' }, { title: 'Finlans' }, { title: 'Fijs' }, { title: 'Falkland Islands' }, { title: 'Micronesis' }, { title: 'Faroe Islands' }, { title: 'Francs' }, { title: 'Gabos' }, { title: 'Englans' }, { title: 'Grenads' }, { title: 'Georgis' }, { title: 'French Guians' }, { title: 'Ghans' }, { title: 'Gibraltas' }, { title: 'Greenlans' }, { title: 'Gambis' }, { title: 'Guines' }, { title: 'Guadeloups' }, { title: 'Equatorial Guines' }, { title: 'Greecs' }, { title: 'Sandwich Islands' }, { title: 'Guatemals' }, { title: 'Guas' }, { title: 'Guinea-Bissas' }, { title: 'Guyans' }, { title: 'Hong Kons' }, { title: 'Heard Islans' }, { title: 'Honduras' }, { title: 'Croatis' }, { title: 'Haits' }, { title: 'Hungars' }, { title: 'Indonesis' }, { title: 'Irelans' }, { title: 'Israes' }, { title: 'Indis' }, { title: 'Indian Ocean Territors' }, { title: 'Iras' }, { title: 'Iras' }, { title: 'Icelans' }, { title: 'Itals' }, { title: 'Jamaics' }, { title: 'Jordas' }, { title: 'Japas' }, { title: 'Kenys' }, { title: 'Kyrgyzstas' }, { title: 'Cambodis' }, { title: 'Kiribats' }, { title: 'Comoros' }, { title: 'Saint Kitts and Nevis' }, { title: 'North Kores' }, { title: 'South Kores' }, { title: 'Kuwais' }, { title: 'Cayman Islands' }, { title: 'Kazakhstas' }, { title: 'Laos' }, { title: 'Lebanos' }, { title: 'Saint Lucis' }, { title: 'Liechtensteis' }, { title: 'Sri Lanks' }, { title: 'Liberis' }, { title: 'Lesoths' }, { title: 'Lithuanis' }, { title: 'Luxembours' }, { title: 'Latvis' }, { title: 'Libys' }, { title: 'Moroccs' }, { title: 'Monacs' }, { title: 'Moldovs' }, { title: 'Montenegrs' }, { title: 'Madagascas' }, { title: 'Marshall Islands' }, { title: 'MacEdonis' }, { title: 'Mals' }, { title: 'Burms' }, { title: 'Mongolis' }, { title: 'MacAs' }, { title: 'Northern Mariana Islands' }, { title: 'Martiniqus' }, { title: 'Mauritanis' }, { title: 'Montserras' }, { title: 'Malts' }, { title: 'Mauritius' }, { title: 'Maldives' }, { title: 'Malaws' }, { title: 'Mexics' }, { title: 'Malaysis' }, { title: 'Mozambiqus' }, { title: 'Namibis' }, { title: 'New Caledonis' }, { title: 'Niges' }, { title: 'Norfolk Islans' }, { title: 'Nigeris' }, { title: 'Nicaragus' }, { title: 'Netherlands' }, { title: 'Norwas' }, { title: 'Nepas' }, { title: 'Naurs' }, { title: 'Nius' }, { title: 'New Zealans' }, { title: 'Omas' }, { title: 'Panams' }, { title: 'Pers' }, { title: 'French Polynesis' }, { title: 'New Guines' }, { title: 'Philippines' }, { title: 'Pakistas' }, { title: 'Polans' }, { title: 'Saint Pierrs' }, { title: 'Pitcairn Islands' }, { title: 'Puerto Rics' }, { title: 'Palestins' }, { title: 'Portugas' }, { title: 'Palas' }, { title: 'Paraguas' }, { title: 'Qatas' }, { title: 'Reunios' }, { title: 'Romanis' }, { title: 'Serbis' }, { title: 'Russis' }, { title: 'Rwands' }, { title: 'Saudi Arabis' }, { title: 'Solomon Islands' }, { title: 'Seychelles' }, { title: 'Sudas' }, { title: 'Swedes' }, { title: 'Singapors' }, { title: 'Saint Helens' }, { title: 'Slovenis' }, { title: 'Svalbard, I Flag Jan Mayes' }, { title: 'Slovakis' }, { title: 'Sierra Leons' }, { title: 'San Marins' }, { title: 'Senegas' }, { title: 'Somalis' }, { title: 'Surinams' }, { title: 'Sao Toms' }, { title: 'El Salvados' }, { title: 'Syris' }, { title: 'Swazilans' }, { title: 'Caicos Islands' }, { title: 'Chas' } ]; }); ``` -------------------------------- ### Semantic UI Search with Remote API Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/search.html Configures the Semantic UI search component to fetch results from a remote API. The 'action' parameter in 'apiSettings' specifies the API endpoint for search queries. ```javascript $('.search.demo .remote').search({ apiSettings: { action: 'search' } }); ``` -------------------------------- ### Semantic UI Dimmable Section Event Handlers Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/dimmer.html Sets up click event handlers for buttons to control the visibility of Semantic UI dimmers. This includes showing/hiding segment dimmers and page dimmers. ```javascript $(document).ready(function() { // selector cache var $demo = $('.dimmer.demo'), $showButton = $demo.find('.show.button'), $pageButton = $demo.find('.page.button'), $hideButton = $demo.find('.hide.button'); // alias handler var handler = { show: function() { $(this).closest('.demo').find('.segment').dimmer('show'); }, hide: function() { $(this).closest('.demo').find('.segment').dimmer('hide'); }, page: function() { $('body > .demo.page.dimmer').dimmer('show'); } }; // event handlers $pageButton.on('click', handler.page); $showButton.on('click', handler.show); $hideButton.on('click', handler.hide); }); ``` -------------------------------- ### Semantic UI Container Padding Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/documents/hotfix.html Applies top padding to elements with the 'ui container' class, commonly used for layout spacing in Semantic UI. ```css .ui.container { padding-top: 6em; } ``` -------------------------------- ### Sidebar Animation Control Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/sidebar.html This JavaScript code initializes Semantic UI sidebar components and handles user interactions to control animation direction, transition type, and page dimming. It dynamically updates button states based on the selected direction. ```javascript $(document) .ready(function() { $(".sidebar.direction.demo") .find(".buttons .button") .on("click", function() { var direction = $(this).data("direction") ; $(this).addClass("active").siblings().removeClass("active"); if(direction === "top" || direction === "bottom") { $(".horizontal.button").addClass("disabled"); } else { $(".horizontal.button").removeClass("disabled"); } }) .end() .children(".button") .on("click", function() { var transition = $(this).data("transition"), direction = $(".sidebar.direction.demo .buttons .button.active").data("direction"), dimPage = $(".sidebar.direction.demo .dim").checkbox("is checked") ; if( $(this).filter(".disabled").size() === 0) { $("." + direction + ".demo.sidebar") .not(".styled") .sidebar("setting", { dimPage : dimPage, transition : transition, mobileTransition : transition }) ; $("." + direction + ".demo.sidebar").not(".styled").sidebar("toggle"); } }) ; }) ; }) ; ``` -------------------------------- ### Semantic UI Search with Category Filtering Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/search.html Implements category-based search functionality using the Semantic UI search component. The 'type' is set to 'category', and 'apiSettings' defines the 'categorySearch' action for fetching categorized results. ```javascript $('.search.demo .category').search({ type: 'category', apiSettings: { action: 'categorySearch' } }); ``` -------------------------------- ### Semantic UI Dimmable Section CSS Styling Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/dimmer.html Provides CSS rules for styling Semantic UI dimmable sections, specifically targeting page dimmers and adjusting margins for better layout. ```css .dimmer.demo:not(.page) { margin: 2em 0em; } h4 + .dimmer.demo { margin-top: 0em; } ``` -------------------------------- ### Semantic UI Menu Item Click Handler Source: https://github.com/semantic-org/semantic-ui-docs/blob/master/server/partials/examples/menu.html This JavaScript code snippet demonstrates how to handle click events on menu items in Semantic UI. It adds an 'active' class to the clicked item and removes it from other items within the same menu, excluding dropdowns. ```javascript $(document) .ready(function(){ $('.demo .example .menu a.item') .on('click', function() { if(!$(this).hasClass('dropdown')) { $(this) .addClass('active') .closest('.ui.menu') .find('.item') .not($(this)) .removeClass('active') ; } }) ; }) ; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.