Preloaders

We have ceased to notice that majority of components that need a little time in order to fully load or perform can be a time-consuming action accompanied by small, pleasant indicators that visualize the process. You can stumble upon these tiny assistants everywhere — apps in cellphones or tablets, personal websites, online services are highly populated with such animated control elements that try to make the user experience more pleasant and more enjoyable.

Usually it is a simple throbber that for a long time was a gif animation, and only recently has become a code-based solution that involves utilization of either JS or/and CSS, thereby opening up almost endless possibilities to developers.

Default

loading

Puff

Audio

Ball Triangle

Bars

Circles

Grid

Oval

Rings

Tail Spin

Three Dots

Simple

Gooey

Logo Gooey

Spiner

Accordion

Create a list of items, allowing each item's content to be expanded and collapsed by clicking its header.

Usage

To apply the Accordion component, add the uk-accordion class and the data-uk-accordion attribute to a container element. Add the uk-accordion-content class to each of the content sections within the container. Finally, add the uk-accordion-title class to any element, like a heading, above the content section to create a toggle.

Example

Heading 1

Heading 2

Heading 3

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Markup

<div class="uk-accordion" data-uk-accordion>

    <h3 class="uk-accordion-title">...</h3>
    <div class="uk-accordion-content">...</div>

    <h3 class="uk-accordion-title">...</h3>
    <div class="uk-accordion-content">...</div>

    <h3 class="uk-accordion-title">...</h3>
    <div class="uk-accordion-content">...</div>

</div>

Muliple open items

To display multiple content sections at the same time without one collapsing when the other one is opened, add the {collapse: false} option to the date attribute.

Example

Heading 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Heading 2

Heading 3


JavaScript options

Option Possible value Default Description
showfirst boolean true Show first item on init
collapse boolean true Allow multiple open items
animate boolean true Animate toggle
easing string swing Animation function
duration integer 300 Animation duration
toggle string .uk-accordion-title Css selector for toggles
containers string .uk-accordion-content Css selector for content containers
clsactive string uk-active Class to add when an item is active

Init element manually

var accordion = UIkit.accordion(element, { /* options */ });

Events

Name Parameter Description
toggle.uk.accordion event, active, toggle, content On item toggle

Navbar

Defines different styles for the navigation bar.

Usage

The Navbar component consists of the navbar itself and one or more navigations.

Class Description
.uk-navbar Add this class to a <nav> element to define the Navbar component.
.uk-navbar-nav Add this class to a <ul> element to create a navigation. Use <a> elements as menu items within the list.
.uk-active Add this class to a list item to apply an active state.
.uk-parent Add this class to indicate a parent menu item.

Example

Markup

<nav class="uk-navbar">
    <ul class="uk-navbar-nav">
        <li class="uk-active"><a href="">...</a></li>
        <li><a href="">...</a></li>
        <li class="uk-parent"><a href="">...</a></li>
    </ul>
</nav>

Navbar flip

Add the .uk-navbar-flip class to a <div> element to group and align navigations and items to the right.

Example

Markup

<nav class="uk-navbar">
    <div class="uk-navbar-flip">
        <ul class="uk-navbar-nav">
            <li><a href="">...</a></li>
        </ul>
    </div>
</nav>

Navbar subtitle

Add the .uk-navbar-nav-subtitle class to an <a> element in the list item to indicate that it has a subtitle. Use a <div> element for the subtitle itself.

Example

Markup

<nav class="uk-navbar">
    <ul class="uk-navbar-nav">
        <li><a href="" class="uk-navbar-nav-subtitle">
            ...
            <div>...</div>
        </a></li>
    </ul>
</nav>

Content

You can also add custom content to the navbar, like text, icons, buttons, forms or even a toggle. By default, there is no JavaScript attached to the toggle. As an example, you can add an off-canvas navigation from the Off-canvas component.

Class Description
.uk-navbar-content Add this class to a <div> element, which serves as a container for your custom content. The content will be centered vertically.
.uk-navbar-brand Add this class to an <a> or <div> element to indicate your brand.
.uk-navbar-center Add this class to center your navbar content or brand. The element needs to be the last child in the navbar.
.uk-navbar-toggle Add this class to an <a> or <div> element to create an icon as a toggle.
.uk-navbar-toggle-alt Add this class to create an alternative icon as a toggle.

Example

Markup

<nav class="uk-navbar">
    <a href="" class="uk-navbar-brand">...</a>
    <ul class="uk-navbar-nav">...</ul>
    <div class="uk-navbar-content">...</div>
    <div class="uk-navbar-content uk-navbar-center">...</div>
    <a href="" class="uk-navbar-toggle"></a>
</nav>

Responsive visibility

To hide or display certain navbar items, just add one of the responsive visibility classes from the Utility component. This comes in handy, if you want to use a toggle to trigger a mobile navigation for example.

Example

Resize your browser window to see it in action.

Lorem ipsum dolor sit amet, consetetur sadipscing elitr.

Markup

<nav class="uk-navbar">
    <ul class="uk-navbar-nav uk-hidden-small">...</ul>
    <a href="#my-id" class="uk-navbar-toggle uk-visible-small" data-uk-offcanvas></a>
</nav>

<div id="my-id" class="uk-offcanvas">
    ...
</div>

NOTE In this example we added an off-canvas sidebar fron the Off-canvas component.


Modifiers

To display the navbar in a different style, just add modifier classes. These modifiers can be combined with each other

Navbar attached

Add the .uk-navbar-attached class to optimize the navbar's styling to be attached to the top of the viewport. For example, rounded corners will be removed.

Example

Markup

<nav class="uk-navbar uk-navbar-attached">...</nav>

A navbar can contain a dropdown from the Dropdown component. Just add the .uk-dropdown-navbar modifier to the dropdown, so it fits perfectly into the navbar's styling.

Example

Animation

A basic collection of smooth animations to use within your page.

Usage

To apply this component, add any .uk-animation-* class to an element and it will fade in with a nice animation. These classes are commonly set by using JavaScript to apply the animation to specific behaviors.

Class Description
.uk-animation-fade The element fades in.
.uk-animation-scale-up The element scales up.
.uk-animation-scale-down The element scales down.
.uk-animation-slide-top The element slides in from the top.
.uk-animation-slide-bottom The element slides in from the bottom.
.uk-animation-slide-left The element slides in from the left.
.uk-animation-slide-right The element slides in from the right.
.uk-animation-shake The element shakes.
.uk-animation-scale The element scales down without fading in.

Example

Click on any of the boxes to see the animation.

Fade
Scale up
Scale down
Shake
Slide top
Slide bottom
Slide left
Slide right
Scale

Markup

<div class="uk-animation-fade">...</div>

Reverse modifier

By default, all aimations are incoming. To reverse any animation, add the .uk-animation-reverse class.

Example

Click on any of the boxes to see the animation.

Fade
Scale up
Scale down
Shake
Slide top
Slide bottom
Slide left
Slide right
Scale

Markup

<div class="uk-animation-fade uk-animation-reverse">...</div>

Duration modifier

To stretch the animation duration to 15 seconds, add the .uk-animation-15 class.

Example

Slide right

Markup

<div class="uk-animation-slide-right uk-animation-15">...</div>

Origin modifier

By default, scaling animations originate from the center. To modify this behavior, add one of these classes.

Class Description
.uk-animation-top-left The animation spreads from the top left.
.uk-animation-top-center The animation spreads from the top center.
.uk-animation-top-right The animation spreads from the top right.
.uk-animation-middle-left The animation spreads from the middle left.
.uk-animation-middle-right The animation spreads from the middle right.
.uk-animation-bottom-left The animation spreads from the bottom left.
.uk-animation-bottom-center The animation spreads from the bottom center.
.uk-animation-bottom-right The animation spreads from the bottom right.

Example

Click on any of the boxes to see the animation.

Top Left
Top Center
Top Right
Middle Left
Middle Right
Bottom Left
Bottom Center
Bottom Right

Animation hover

To trigger an animation on hover, just add the .uk-animation-hover class to the animated element itself or to a container.

Example

Fade
Slide right

Markup

<div class="uk-animation-hover uk-animation-fade">...</div>

<div class="uk-animation-hover">
    <div class="uk-animation-slide-right">...</div>
</div>

Panel

Create layout boxes with different styles.

UIkit uses panels to outline certain sections of your content, which can be styled differently. Typically, panels are arranged in grid columns from the Grid component.


Usage

The Panel component consists of the panel itself, the panel title and a panel badge. To prevent redundant white space, top and bottom margins are removed from the panel's content.

Class Description
.uk-panel Add this class to a <div> element to define the Panel component.
.uk-panel-title Add this class to a heading to create the panel title.
.uk-panel-badge Add this class to a <div> element to create a panel badge. The easiest way to style your badge, is by adding the modifier classes from the Badge component.

Example

Hot

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

NOTE By default, a panel is blank and has no styling. That is why it is important to add a modifier class, which gives the panel some styling. In our examples we used the .uk-panel-box class.

Markup

<div class="uk-panel">
    <div class="uk-panel-badge uk-badge">...</div>
    <h3 class="uk-panel-title">...</h3>
    ...
</div>

Panels in a grid

This is a short example of how to use panels with the Grid component. Both panels are using the .uk-width-medium-1-2 class.

Example

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor.

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor.

Markup

<div class="uk-grid">
    <div class="uk-width-medium-1-2">
        <div class="uk-panel">...</div>
    </div>
    <div class="uk-width-medium-1-2">
        <div class="uk-panel">...</div>
    </div>
</div>

Modifiers

Modifier classes are necessary to add a specific style to panels. UIkit includes a number of panel modifiers and you also have the possibility to create your own.

Panel box

Add the .uk-panel-box class to create a visually styled box. This is the default panel modifier.

Example

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. .uk-panel-box

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. .uk-panel-box

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. .uk-panel-box

Markup

<div class="uk-panel uk-panel-box">...</div>

NOTE To create a hover effect on the panel, just add the .uk-panel-box-hover class. This comes in handy when working with anchors.


Panel box primary

Add the .uk-panel-box-primary class to modify the box panel and emphasize it with a different color.

Example

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. .uk-panel-box-primary

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. .uk-panel-box-primary

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. .uk-panel-box-primary

Markup

<div class="uk-panel uk-panel-box uk-panel-box-primary">...</div>

NOTE To create a hover effect on the panel, just add the .uk-panel-box-primary-hover class. This comes in handy when working with anchors.


Panel box secondary

Add the .uk-panel-box-secondary class to modify the box panel and give it a white background.

Example

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. .uk-panel-box-secondary

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. .uk-panel-box-secondary

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. .uk-panel-box-secondary

Markup

<div class="uk-panel uk-panel-box uk-panel-box-secondary">...</div>

NOTE To create a hover effect on the panel, just add the .uk-panel-box-secondary-hover class. This comes in handy when working with anchors.


Panel hover

Add the .uk-panel-hover class to add a hover effect to the panel. This comes in handy when using the panel as an anchor.

Example

Markup

<a class="uk-panel uk-panel-hover" href="">...</a>

Panel header

Add the .uk-panel-header class to separate the panel title and content with a horizontal line.

Example

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. .uk-panel-header

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. .uk-panel-header

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. .uk-panel-header

Markup

<div class="uk-panel uk-panel-header">...</div>

Panel space

Add the .uk-panel-space class to increase the spacing around the panel content.

Example

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. .uk-panel-space

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. .uk-panel-space

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. .uk-panel-space

Markup

<div class="uk-panel uk-panel-space">...</div>

Panel divider

Add the .uk-panel-divider class to separate vertically stacked panels with lines.

Example

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. .uk-panel-divider

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. .uk-panel-divider

Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. .uk-panel-divider

Markup

<div class="uk-grid">
    <div class="uk-width-medium-1-2">
        <div class="uk-panel uk-panel-divider">...</div>
        <div class="uk-panel uk-panel-divider">...</div>
        <div class="uk-panel uk-panel-divider">...</div>
    </div>
</div>

NOTE Use the .uk-grid-divider class from the Grid component to separate grid columns.


Panel box with teaser

To display an image inside a panel box that is attached to the border of the panel without any spacing, just add the .uk-panel-teaser class to a <div> element inside the panel.

Example

Lorem ipsum dolor sit amet, consectetur adipisicing elit.

Markup

<div class="uk-panel uk-panel-box">
    <div class="uk-panel-teaser">
        <img src="" alt="">
    </div>
</div>

Panel with icons

Easily apply an icon from our Icon component to your panel by adding one of the .uk-icon-* classes to an <i> or <span> element inside the panel title.

Example

Panel

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Panel

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Panel

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Markup

<div class="uk-panel">
    <h3 class="uk-panel-title"><i class="uk-icon-*"></i>...</h3>
</div>

More Articles ...

Chameleon I.T are a client focused consultancy seeking to deliver IT efficiency gains through software and consulting solutions.

These solutions seek to take existing systems and optimise them in conjunction with adding cutting edge technologies to complement.

 

Map

Contact us

Phone:
01727 831 383
Email:
info@chameleonit.co.uk
Mon-Fri:
9am to 5pm

Search