Category Archives: UIkit

UIkit Table


UIkit Table– Class uk-tableis used to create table in UIkit framework. You can use predefined classes to create beautiful tables in UIkit framework. Here in this article we are going to explain how you can create tables in UIkit with different-different styles.


UIkit Table Example

Add class uk-table to table. Here is simple example of UIkit table. –

Example:

Name Email
Jhon jhon@example.com
Kelly kelly@example.com

Try it »

If you run the above example it will produce the output something like this-

Uikit Table Example

Add Row Divider

Add class uk-table-divider to add divider between table rows.

Example:

Name Email
Jhon jhon@example.com
Kelly kelly@example.com

Try it »

If you run the above example it will produce output something like this-

Uikit table row divider

Striped Row

Add class uk-table-striped to create striped table row.

Example:

Name Email
Jhon jhon@example.com
Kelly kelly@example.com

Try it »

If you run the above example it will produce the output something like this-

striped table row

Hover Effect

If you want to add the hover effect on table rows add class uk-table-hover to table.

Example:

Name Email
Jhon jhon@example.com
Kelly kelly@example.com

Try it »

Responsive table

To make table responsive add class uk-overflow-auto to div wrapper and add table inside it. Table will be automatically responsive on all devices.

Example:

Name Email
Jhon jhon@example.com
Kelly kelly@example.com

UIkit Form


UIkit Form– UIkit provides classes to create beautiful form with different styles. Here in this article we are going to explain how you can use pre defined classes to create form elements. You can also use our online editor to edit and run the code online.


UIkit Form | Input | Controls Example

Let us create a simple form with basic elements.

Example:

Try it »

If you run the above example it will produce output something like this-

Uikit form example

Input Classes

Following classes are available which you can use to create form elements.

Name Class Description
Input .uk-input This is input class, add to <input> elements.
Select Box .uk-select This is select class, add this to <select> elements.
Textarea .uk-textarea This is textarea class, add this to <textarea> elements.
Radio Button .uk-radio This is radio button class, add this to <input type=”radio”> elements.
Checkbox .uk-checkbox This class is used to create checkboxes, Add this class to <input type=”checkbox”> elements.
Range .uk-range This class is used to create range element add this to range element <input type=”range”>.

State Modifiers

Following state modifier classes are available-

Class Description
.uk-form-danger This is used to represent the danger state such as error message.
.uk-form-success This is used to reresent that action has been successfully performed.

Now let us create a simple example.

Example:

Try it »

If you run the above example it will produce output something like this-

Uikit Form state modifiers

Size Modifiers

You can change the size of form elements using the following modifiers-

Class Description
.uk-form-large This is used to create large elements.
.uk-form-small This is used to create small elements.

You can use the above classes simply as below-

Example:

Try it »

If you run the above example it will produce the output something like this-

Uikit Form element size example

Width Modifiers

Using with modifiers we can create large, medium, small and extra small elements. You can modify width of input, select, textarea or other elements using this modifier. Here is an example of width modifier.

Example:

Try it »

If you run the above example it will produce output something like this-

Uikit change input size

Layout Controls | Horizontal | Vertical Form

You can add labels, controls to stacked or horizontal layout.

Class Description
.uk-form-stacked This is used to display lables top of controls.
.uk-form-horizontal This is used to display the labels & controls side by side.
.uk-form-label This is used to define the label.
.uk-form-controls Define the form controls.

Vertical Form | Stacked Form

Class .uk-form-stacked is used to create stacked form.

Example:

Try it »

If you run the above example it will produce output something like this-

horizontal form

Horizontal Form

Add class uk-form-horizontal to create horizontal form in UIkit. Here is an example of horizontal form.

Example:

Try it »

Output of above example-

Horizontal form

Add Icon To Input

You can add icons simply as below-

Custom Controls

You can create custom controls such as file, select dropdown box.

File

You can create custom select upload box simply as below-

Upload File
upload

Select Dropdown Box

You can replace the default select dropdown by uikit design simply as below-

 

UIkit Card


UIkit Card– You can create layout boxes using card classes in beautiful styles. Class uk-card is used to create cards in UIkit framework. Here in this article we are going to explain how you can use the card classes and modifier classes to create beautiful cards.


UIkit Card Example

Following classes are used to define a card in UIKit-

Class Description
.uk-card This class is used to define the Card component.
.uk-card-body This class defines the body of card.
.uk-card-title This is used to define the card title.

Let us create a simple example.

UIkit Card Example:

Tutorialsplane

Learn to Create Hybrid Mobile Apps with High Performance, Native Focused and Beautiful Design. Learn with Online Demo & Examples .

Try it »

If you run the above example it will produce output something like this-

UIkit Card Example

Style Modifiers

Following modifier classes are available-

  • uk-card-default– This class is used to create the default style card.
  • uk-card-primary– This creates a card with primary color style.
  • uk-card-secondary– This class is used to modify the card and adds secondary background color.

Example

Uikit Card Modifiers:

Default

Lorem ipsum dolor sit amet, consectetur adipisicing elit.

Primary

Lorem ipsum dolor sit amet, consectetur adipisicing elit.

Secondary

Lorem ipsum dolor sit amet, consectetur adipisicing elit.

Try it »

If you run the above example it will produce output like this-

UIkit Card Example

Size Modifiers

You can use the following size modifiers to changes the size of cards.

  • .uk-card-small: This adds a smaller padding.
  • .uk-card-large: This adds larger padding.

Header & Footer

Class uk-card-header and uk-card-footer is used to add the header and footer of card.

Header & Footer Example:

Header

Body

Try it »

UIkit Button


UIkit Button UIkit provides classes to create beautiful buttons. You can create various type of buttons using predefined classes. Here in this article we are going to explain how to create UIkit buttons.


UIkit Button Example

To create a button add class .uk-button and modifier class uk-button-default.-

UIkit Button | Example:


Try it »

UIkit Button Example

Style Modifiers

Following style modifiers are available which we can use to create beautiful buttons.

Button Class Description
Default Button .uk-button-default Default button style.
Primary Button .uk-button-primary Creates Primary Button.
Secondry Button .uk-button-secondary Creates Secondary Button.
Danger Button .uk-button-danger Creates a danger button.
Text Button .uk-button-text Applies an alternative, typographic style.
Link Button .uk-button-link Creates a link button.

Example

Let us create an example to understand the above modifiers.

Button Modifiers Example:







Try it »

If you run the above example it will produce output something like this-

UIkit Button Example

Size Modifiers

You can use following size modifiers to change the button size.

  • Small Button– Class uk-button-small is used to create small button.
  • Large Button– Class uk-button-large is used to create large button.

Button Size Modifier Example:


   


   

Try it »

If you the above example it will produce the output something like this-

Uikit Buttons Example

Width Modifiers

You can use width modifiers to create block level buttons. Add class uk-width-1-1 to make button full width.

UIkit Block Level Buttons Example:




Try it »

Output of above example-

UIkit Block Buttons

Button Group

Add a div wrapper with class uk-button-group to create button groups.

| Example:

Try it »

UIkit Button Groups

Button with Dropdown

You can create buttons with dropdown in UIkit framework using predefined classes. Here is an example of dropdown button with nav header and nav divider.

Dropdown Button Example:

Try it »

UIkit Breadcrumb


UIkit Breadcrumb– Breadcrumb is basically used to represent the user location on website. Class .uk-breadcrumb is used to create breadcrumb. Here in this article we are going to explain how to use this class. You can also use our online editor to edit and run the code online.


UIkit Breadcrumb Example

Add class uk-breadcrumb to <ul> and add <li> and <a>. If you want to show active link item replace <a> by <span>. Here is simple example of breadcrumb –

UIkit Breadcrumb | Example:


Try it »

If you run the above example it will produce the output something like this-

UIkit Breadcrumb Example

Active Breadcrumb Item

Replace <a> by <span> to make an item active.


Disable Breadcrumb Item

Add class uk-disabled to <li> make disabled breadcrumb.


UIkit Badge


UIkit Badge: Class uk-badge is used to create badge in UIkit framework. Here in this article, we are going to explain how to create badge icons in UIkit framework. You can also use our online editor to edit and run the code.


UIkit Badge Example

Add class uk-badge to element to create a badge. Here is an example-

UIkit Badge Example:


Try it »

If you run the above example it will produce the output something like this-

UIkit Badge Example

UIkit Article


UIkit Article– UIkit provides classes to create articles which contains- title and metadata. Here in this tutorial, we are going to explain how you can create Articles in UIkit framework.


UIkit Article Example

Class uk-article is used to define the article body,uk-article-title is used to add the title of article, uk-article-meta is used to add the meta information. Here is simple example of article-

UIkit Article Example:

Tutorialsplane.com

Tutorialsplane is the world's largest learning website..you can get interesting article with example and demo.

Try it »

If you run the above example it will produce output something like this.

UIkit Article Example

UIkit Align


UIkit Align– This component allows us to control the alignment of elements. Here in this tutorial, we are going to explain how to align elements in UIkit. You can also use online editor to edit and run the code online.


UIkit Align Text | Image Left | Right | Center Component Example

You can use following classes to align Text/Element/Image in UIkit-

  1. uk-align-left– This is used to float left with right and bottom margin.
  2. uk-align-right– This is used to align right with left and bottom margin.
  3. uk-align-center– This is used to center the element and adds the bottom margin.

Here is an example of alignment classes

UIkit Align Component Example:

Align Left

Align Right

Align Center

Try it »

If you run the above example it will produce the output something like this-

UIkit Align Example

Responsive Classes

Following responsive classes are available which will work on Only specific devices.

Class Description
.uk-align-left@s
.uk-align-right@s
Apply only device of width 640px and higher.
.uk-align-left@m
.uk-align-right@m
Apply only device of width 960px and higher.
.uk-align-left@l
.uk-align-right@l
Apply only device of width1200px and higher.
.uk-align-left@xl
.uk-align-right@xl
Apply only device of width 1600px and higher.

UIkit Alert


UIkit Alert– UIkit uk-alert component is used to create alert messages such as success, warning and error. It is very simple to use this component. Here in this article we are going to explain how to use alert component in UIkit.


UIkit Alert Component Example

There are following Types of Alert boxes available in UIkit-

  1. Primary
  2. Success
  3. Warning
  4. Danger

Add uk-alert attribute to block element to create alert messages.-

UIkit Alert Component Example:

Your order has been received.

Try it »

If you run the above example it will produce the output something like this-

UIkit Alert Component Example

Close Button

Add class uk-alert-close and attribute uk-close to create close button.

Primary Alert

Add class uk-alert-primary along with attribute uk-alert.

Primary Alert Example:

Primary Alert Example.

Try it »

If You run the above example it will produce the output something like this-

UIkit Alert Component Example

Success Alert

Add class uk-alert-success along with attribute uk-alert.

Primary Alert Example:

Success Alert Example.

Try it »

Output of above example will be-

UIKit Success Alert

Warning Alert

Add class uk-alert-warning along with attribute uk-alert.

Warning Alert Example:

Warning Alert Example.

Try it »

Output of above example will be-

Warning Alert

Danger Alert

Add class uk-alert-danger along with attribute uk-alert.

Danger Alert Example:

Danger Alert Example.

Try it »

Output of above example will be-

Danger Alert Example

Component Options

Option Value Default Description
animation Boolean, String true Fade out.
duration Number 150 Animation duration in milliseconds.
sel-close CSS selector .uk-alert-close The close trigger element.

JavaScript

Initialization

UIkit.alert(element, options);

Events

  • beforehide– This event fires before hide.
  • hide– Fires when an item is hidden.

Methods

Following methods are available-

Close

UIkit.alert(element).close();