Documentation
IntroductionLayout
Text
- Accordion
- Alert
- Animation
- Align
- Badge
- Base
- Breadcrumb
- Button
- Card
- Close
- Comment
- Description List
- Divider
- Dotnav
- Drop
- Dropdown
- Filter
- Form
- Height
- Icon
- Iconnav
- Image
- Inverse
- Label
- Leader
- Lightbox
- Link
- List
- Margin
- Marker
- Modal
- Nav
- Navbar
- Notification
- Off-canvas
- Overlay
- Padding
- Pagination
- Parallax
- Placeholder
- Position
- Print
- Progress
- Scroll
- Scrollspy
- Search
- Section
- Slidenav
- Slider
- Slideshow
- Sortable
- Spinner
- Sticky
- Subnav
- SVG
- Switcher
- Tab
- Table
- Thumbnav
- Tile
- Toggle
- Tooltip
- Totop
- Transition
- Upload
- Utility
- Video
- Visibility
Utility
A collection of useful utility classes to style your content.
Panel
UIkit uses panels to outline certain sections of your content. These can be arranged in grid columns from the Grid component component, for example.
Add the .uk-panel
class to a <div>
element to create a position context, set box-sizing to border-box, apply a clearfix and to remove the bottom margin of its last child element.
<div class="uk-child-width-1-3@s" uk-grid>
<div>
<div class="uk-panel">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
</div>
<div>
<div class="uk-panel">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
</div>
<div>
<div class="uk-panel">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
</div>
</div>
Scrollable panel
Add the .uk-panel-scrollable
class to give the panel a fixed height and make it scrollable, if its content exceeds the height. You can also add one of the .uk-height-*
classes to apply a different height.
<div class="uk-panel uk-panel-scrollable">
<ul class="uk-list">
<li><label><input class="uk-checkbox" type="checkbox"> Category 1</label></li>
<li>
<label><input class="uk-checkbox" type="checkbox"> Category 2</label>
<ul>
<li><label><input class="uk-checkbox" type="checkbox"> Category 2.1</label></li>
<li><label><input class="uk-checkbox" type="checkbox"> Category 2.2</label></li>
<li>
<label><input class="uk-checkbox" type="checkbox"> Category 2.3</label>
<ul>
<li><label><input class="uk-checkbox" type="checkbox"> Category 2.3.1</label></li>
<li><label><input class="uk-checkbox" type="checkbox"> Category 2.3.2</label></li>
</ul>
</li>
<li><label><input class="uk-checkbox" type="checkbox"> Category 2.4</label></li>
</ul>
</li>
<li><label><input class="uk-checkbox" type="checkbox"> Category 3</label></li>
<li><label><input class="uk-checkbox" type="checkbox"> Category 4</label></li>
</ul>
</div>
Clearing and floating
Floating elements are taken from the document flow and aligned to the left or right side of their container. It is important to clear floats or in the worst case, you might end up with a scrambled site. The following classes will help you to set up basic layouts.
Class | Description |
---|---|
.uk-float-left |
Add this class to float the element to the left. |
.uk-float-right |
Add this class to float the element to the right. |
.uk-clearfix |
Add this class to a parent container to clear floats. Alternatively, you can create a new block format context, e.g. by adding the .uk-overflow-hidden class. |
<div class="uk-clearfix">
<div class="uk-float-right">
<div class="uk-card uk-card-default uk-card-body">Right</div>
</div>
<div class="uk-float-left">
<div class="uk-card uk-card-default uk-card-body">Left</div>
</div>
</div>
Overflow
These utilities provide different classes to modify an element’s overflow behavior.
Class | Description |
---|---|
.uk-overflow-hidden |
Add this class to clip content that exceeds the dimensions of its container. |
.uk-overflow-auto |
Add this class to create a container that provides a horizontal or vertical scrollbar whenever the elements content it are wider or higher than the container itself. |
Note The .uk-overflow-auto
class is useful when having to handle tables on a responsive website, which at some point would just get too big. It also works great on <pre>
elements.
<div class="uk-overflow-auto uk-height-small">
<table class="uk-table uk-table-striped uk-table-condensed uk-text-nowrap">
<thead>
<tr>
<th>Table Heading</th>
<th>Table Heading</th>
<th>Table Heading</th>
<th>Table Heading</th>
<th>Table Heading</th>
<th>Table Heading</th>
<th>Table Heading</th>
<th>Table Heading</th>
</tr>
</thead>
<tfoot>
<tr>
<td>Table Footer</td>
<td>Table Footer</td>
<td>Table Footer</td>
<td>Table Footer</td>
<td>Table Footer</td>
<td>Table Footer</td>
<td>Table Footer</td>
<td>Table Footer</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>Table Data</td>
<td>Table Data</td>
<td>Table Data</td>
<td>Table Data</td>
<td>Table Data</td>
<td>Table Data</td>
<td>Table Data</td>
<td>Table Data</td>
</tr>
<tr>
<td>Table Data</td>
<td>Table Data</td>
<td>Table Data</td>
<td>Table Data</td>
<td>Table Data</td>
<td>Table Data</td>
<td>Table Data</td>
<td>Table Data</td>
</tr>
</tbody>
</table>
</div>
Overflow Auto
Add the uk-overflow-auto
attribute to expand an element’s height to make it fill the remaining height of a parent container. It provides a vertical scrollbar if its content is higher than the expanded height.
<div class="uk-height-medium">
<div class="js-wrapper">
<p>Some content before the overflow auto container.</p>
<div uk-overflow-auto="selContainer: .uk-height-medium; selContent: .js-wrapper">
<div class="uk-grid-small" uk-grid>
<div class="uk-width-1-2"><img src="images/light.jpg" alt=""></div>
<div class="uk-width-1-2"><img src="images/dark.jpg" alt=""></div>
<div class="uk-width-1-2"><img src="images/photo.jpg" alt=""></div>
<div class="uk-width-1-2"><img src="images/photo2.jpg" alt=""></div>
</div>
</div>
<p>Some content after the overflow auto container.</p>
</div>
</div>
It’s often used within the Modal component.
<div id="my-id" uk-modal>
<div class="uk-modal-dialog" uk-overflow-auto></div>
</div>
<a class="uk-button uk-button-default" href="#modal-overflow" uk-toggle>Open</a>
<div id="modal-overflow" uk-modal>
<div class="uk-modal-dialog">
<button class="uk-modal-close-default" type="button" uk-close></button>
<div class="uk-modal-header">
<h2 class="uk-modal-title">Headline</h2>
</div>
<div class="uk-modal-body" uk-overflow-auto>
<p>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. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p>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. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p>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. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p>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. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p>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. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p>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. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p>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. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p>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. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p>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. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="uk-modal-footer uk-text-right">
<button class="uk-button uk-button-default uk-modal-close" type="button">Cancel</button>
<button class="uk-button uk-button-primary" type="button">Save</button>
</div>
</div>
</div>
You can change the target heights by adding the selContainer
and selContent
options to the attribute. Learn more
Option | Value | Default | Description |
---|---|---|---|
selContainer |
String | .uk-modal |
CSS selector for the container element which provides the height. |
selContent |
String | .uk-modal-dialog |
CSS selector for the element which wraps the inner content to provide its height. |
Resize
These utilities provide different classes for resizing elements.
Class | Description |
---|---|
.uk-resize |
Add this class to enable horizontal and vertical resizing. |
.uk-resize-vertical |
Add this class to enable only vertical resizing. |
Grab and drag the bottom right corner of each box below to resize it
<div class="uk-child-width-1-2@s" uk-grid>
<div>
<pre class="uk-resize-vertical">
<code>
<!-- Resize vertically -->
<div uk-grid>
<div class="uk-width-1-2">...</div>
<div class="uk-width-1-2">...</div>
</div>
<div class="uk-child-width-1-2" uk-grid>
<div></div>
<div></div>
</div>
</code>
</pre>
</div>
<div>
<pre class="uk-resize">
<code>
<!-- Resize horizontally and vertically -->
<div uk-grid>
<div class="uk-width-1-2">...</div>
<div class="uk-width-1-2">...</div>
</div>
<div class="uk-child-width-1-2" uk-grid>
<div></div>
<div></div>
</div>
</code>
</pre>
</div>
</div>
Display
Add one of these classes to change the display properties of an element.
Class | Description |
---|---|
.uk-display-block |
Forces the element to behave like a block element. |
.uk-display-inline |
Forces the element to behave like an inline element. |
.uk-display-inline-block |
Forces the element to behave like an inline-block element. |
Inline
These classes are often used to create a position context on containers with an image as a child. The container keeps the same size as the image as well as the responsive behavior. That way content that is placed on top of the image with the Position component will not flow out of the image dimensions.
Class | Description |
---|---|
.uk-inline |
Add this class to apply inline-block behavior to an element, add a max-width of 100% and to create a position context. |
.uk-inline-clip |
Same as .uk-inline , it but also clips overflowing child elements. |
<div class="uk-inline">
<img alt="">
<div class="uk-position-cover"></div>
</div>
<div class="uk-inline">
<img src="images/photo.jpg" width="300" alt="">
<div class="uk-position-medium uk-position-cover uk-overlay uk-overlay-default uk-flex uk-flex-center uk-flex-middle">Overlay</div>
</div>
Responsive objects
In UIkit <img>
, <canvas>
, <audio>
and <video>
elements adapt to the width of their parent container by default. To apply responsive behavior to iframes, add the uk-responsive
attribute . For other elements or to apply a different behavior, just add one of the following classes.
Class | Description |
---|---|
.uk-responsive-width |
Add this class to apply the same responsive behavior to any other element. It adjusts the object’s width according to its parent’s width, keeping the original aspect ratio. |
.uk-responsive-height |
Add this class to adjust the object’s height (instead of its width) according to its parent’s height, keeping the original aspect ratio. |
.uk-preserve-width |
Add this class to avoid the default responsive behavior and preserve the original image dimensions. You can also add the class to a parent element and it will be applied to all relevant elements content it. If you are embedding Google Maps into your site, you may need this to fix the map’s images. |
<img class="uk-responsive-height" src="" alt="">
<iframe src="" width="" height="" frameborder="0" uk-responsive></iframe>
Border radius
To modify the border radius of an element, like an image, add one of the following classes.
Class | Description |
---|---|
.uk-border-rounded |
Add this class to apply rounded corners. |
.uk-border-circle |
Add this class to apply a circled shape. |
.uk-border-pill |
Add this class to apply a pill shape. |
<img class="uk-border-rounded" src="images/avatar.jpg" width="200" height="200" alt="Border rounded">
<img class="uk-border-circle" src="images/avatar.jpg" width="200" height="200" alt="Border circle">
<img class="uk-border-pill" src="images/avatar.jpg" width="200" height="200" alt="Border pill">
Box shadow
You can apply different box shadows to elements. Just add one of the following classes.
Class | Description |
---|---|
.uk-box-shadow-small |
Add this class to apply a small box shadow. |
.uk-box-shadow-medium |
Add this class to apply a medium box shadow. |
.uk-box-shadow-large |
Add this class to apply a large box shadow. |
.uk-box-shadow-xlarge |
Add this class to apply a very large box shadow. |
<div class="uk-box-shadow-small"></div>
<div class="uk-child-width-1-2@s uk-text-center" uk-grid>
<div>
<div class="uk-box-shadow-small uk-padding">Small</div>
</div>
<div>
<div class="uk-box-shadow-medium uk-padding">Medium</div>
</div>
<div>
<div class="uk-box-shadow-large uk-padding">Large</div>
</div>
<div>
<div class="uk-box-shadow-xlarge uk-padding">X-Large</div>
</div>
</div>
Box shadow bottom
To apply a box shadow at the bottom of an element so that appears to be hovering, add the .uk-box-shadow-bottom
class. This can also be combined with one of the other .uk-box-shadow-*
modifiers.
<div class="uk-box-shadow-bottom"></div>
<div class="uk-box-shadow-bottom uk-box-shadow-small uk-width-1-2@s uk-text-center">
<div class="uk-background-default uk-padding-large">
Box shadow bottom
</div>
</div>
Hover
To apply a box shadow on hover, add one of the following classes. This can also be used to modify the shadow size on hover. To do so, just combine them with one of the classes above.
Class | Description |
---|---|
.uk-box-shadow-hover-small |
Add this class to apply a small box shadow on hover. |
.uk-box-shadow-hover-medium |
Add this class to apply a medium box shadow on hover. |
.uk-box-shadow-hover-large |
Add this class to apply a large box shadow on hover. |
.uk-box-shadow-hover-xlarge |
Add this class to apply a very large box shadow on hover. |
<div class="uk-box-shadow-hover-small"></div>
<div class="uk-child-width-1-2@s uk-text-center" uk-grid>
<div>
<div class="uk-box-shadow-hover-small uk-padding">Hover Small</div>
</div>
<div>
<div class="uk-box-shadow-hover-xlarge uk-padding">Hover X-Large</div>
</div>
<div>
<div class="uk-box-shadow-small uk-box-shadow-hover-large uk-padding">Small + Hover Large</div>
</div>
<div>
<div class="uk-box-shadow-xlarge uk-box-shadow-hover-medium uk-padding">X-Large + Hover Medium</div>
</div>
</div>
Drop cap
With the .uk-dropcap
class you can achieve a drop cap within a text by adding it directly to the <p>
element.
<p class="uk-dropcap">Dorem 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. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
Logo
With the new .uk-logo
class you can easily define your logo, for example within your navbar.
<a class="uk-logo" href=""></a>
<a class="uk-logo" href="#">Logo</a>
Add the .uk-light
class from the Inverse component when displaying the image on dark backgrounds, so that its color will automatically be inverted for better visibility.
<div class="uk-panel uk-padding uk-background-secondary uk-light">
<a class="uk-logo" href="#">Logo</a>
</div>
Logo image
You can also use an <img>
element, for example an SVG, as a logo.
<a class="uk-logo" href="">
<img src="" alt="">
</a>
You can even automatically display alternative logos for light and dark backgrounds by using the Inverse component. Just add the .uk-logo-inverse
class to a second logo image. Depending on the color mode, the inverted logo will be displayed when the .uk-light
or .uk-dark
class is applied to the parent element.
<div class="uk-light">
<a class="uk-logo" href="">
<img src="" alt="">
<img class="uk-logo-inverse" src="" alt="">
</a>
</div>
<div class="uk-child-width-expand@s" uk-grid>
<div>
<div class="uk-panel uk-padding uk-background-muted">
<a class="uk-logo" href="#">
<img src="images/logo-placeholder.svg" alt="">
<img class="uk-logo-inverse" src="images/logo-placeholder-light.svg" alt="">
</a>
</div>
</div>
<div>
<div class="uk-panel uk-padding uk-background-secondary uk-light">
<a class="uk-logo" href="#">
<img src="images/logo-placeholder.svg" alt="">
<img class="uk-logo-inverse" src="images/logo-placeholder-light.svg" alt="">
</a>
</div>
</div>
</div>
Note To inject a SVG logo as inline SVG, use the SVG component.
Blend modes
Add one of the following classes to apply different blend modes to your backgrounds, for example when placing them on images. You can combine these with the Overlay component. For a better understanding of how background blend modes work, take a look at this CSS Tricks article.
Class | Description |
---|---|
.uk-blend-multiply |
This class sets the blend mode to multiply. |
.uk-blend-screen |
This class sets the blend mode to screen. |
.uk-blend-overlay |
This class sets the blend mode to overlay. |
.uk-blend-darken |
This class sets the blend mode to darken. |
.uk-blend-lighten |
This class sets the blend mode to lighten. |
.uk-blend-color-dodge |
This class sets the blend mode to color dodge. |
.uk-blend-color-burn |
This class sets the blend mode to color burn. |
.uk-blend-hard-light |
This class sets the blend mode to hard light. |
.uk-blend-soft-light |
This class sets the blend mode to soft light. |
.uk-blend-difference |
This class sets the blend mode to difference. |
.uk-blend-exclusion |
This class sets the blend mode to exclusion. |
.uk-blend-hue |
This class sets the blend mode to hue. |
.uk-blend-saturation |
This class sets the blend mode to saturation. |
.uk-blend-color |
This class sets the blend mode to color. |
.uk-blend-luminosity |
This class sets the blend mode to luminosity. |
<div class="uk-position-relative">
<div class="uk-blend-multiply uk-overlay uk-overlay-primary"></div>
<img src="" alt="">
</div>
<div class="uk-child-width-1-2 uk-child-width-1-3@s uk-grid-small uk-light" uk-grid>
<div>
<div class="uk-inline uk-background-primary">
<img class="uk-blend-multiply" src="images/dark.jpg" alt="Blend Multiply">
<div class="uk-position-center">
<p class="uk-h4 uk-margin-remove">Multiply</p>
</div>
</div>
</div>
<div>
<div class="uk-inline uk-background-primary">
<img class="uk-blend-screen" src="images/dark.jpg" alt="Blend Screen">
<div class="uk-position-center">
<p class="uk-h4 uk-margin-remove">Screen</p>
</div>
</div>
</div>
<div>
<div class="uk-inline uk-background-primary">
<img class="uk-blend-overlay" src="images/dark.jpg" alt="Blend Overlay">
<div class="uk-position-center">
<p class="uk-h4 uk-margin-remove">Overlay</p>
</div>
</div>
</div>
<div>
<div class="uk-inline uk-background-primary">
<img class="uk-blend-darken" src="images/dark.jpg" alt="Blend Darken">
<div class="uk-position-center">
<p class="uk-h4 uk-margin-remove">Darken</p>
</div>
</div>
</div>
<div>
<div class="uk-inline uk-background-primary">
<img class="uk-blend-lighten" src="images/dark.jpg" alt="Blend Lighten">
<div class="uk-position-center">
<p class="uk-h4 uk-margin-remove">Lighten</p>
</div>
</div>
</div>
<div>
<div class="uk-inline uk-background-primary">
<img class="uk-blend-color-dodge" src="images/dark.jpg" alt="Blend Color Dodge">
<div class="uk-position-center">
<p class="uk-h4 uk-margin-remove">Color Dodge</p>
</div>
</div>
</div>
<div>
<div class="uk-inline uk-background-primary">
<img class="uk-blend-color-burn" src="images/dark.jpg" alt="Blend Color Burn">
<div class="uk-position-center">
<p class="uk-h4 uk-margin-remove">Color Burn</p>
</div>
</div>
</div>
<div>
<div class="uk-inline uk-background-primary">
<img class="uk-blend-hard-light" src="images/dark.jpg" alt="Blend Hard Light">
<div class="uk-position-center">
<p class="uk-h4 uk-margin-remove">Hard Light</p>
</div>
</div>
</div>
<div>
<div class="uk-inline uk-background-primary">
<img class="uk-blend-soft-light" src="images/dark.jpg" alt="Blend Soft Light">
<div class="uk-position-center">
<p class="uk-h4 uk-margin-remove">Soft Light</p>
</div>
</div>
</div>
<div>
<div class="uk-inline uk-background-primary">
<img class="uk-blend-difference" src="images/dark.jpg" alt="Blend Difference">
<div class="uk-position-center">
<p class="uk-h4 uk-margin-remove">Difference</p>
</div>
</div>
</div>
<div>
<div class="uk-inline uk-background-primary">
<img class="uk-blend-exclusion" src="images/dark.jpg" alt="Blend Exclusion">
<div class="uk-position-center">
<p class="uk-h4 uk-margin-remove">Exclusion</p>
</div>
</div>
</div>
<div>
<div class="uk-inline uk-background-primary">
<img class="uk-blend-hue" src="images/dark.jpg" alt="Blend Hue">
<div class="uk-position-center">
<p class="uk-h4 uk-margin-remove">Hue</p>
</div>
</div>
</div>
<div>
<div class="uk-inline uk-background-primary">
<img class="uk-blend-saturation" src="images/dark.jpg" alt="Blend Saturation">
<div class="uk-position-center">
<p class="uk-h4 uk-margin-remove">Saturation</p>
</div>
</div>
</div>
<div>
<div class="uk-inline uk-background-primary">
<img class="uk-blend-color" src="images/dark.jpg" alt="Blend Color">
<div class="uk-position-center">
<p class="uk-h4 uk-margin-remove">Color</p>
</div>
</div>
</div>
<div>
<div class="uk-inline uk-background-primary">
<img class="uk-blend-luminosity" src="images/dark.jpg" alt="Blend Luminosity">
<div class="uk-position-center">
<p class="uk-h4 uk-margin-remove">Luminosity</p>
</div>
</div>
</div>
</div>
Transform center
To center an element to itself, add the uk-transform-center
class. This is particularly useful for absolute positioning.
<div class="uk-inline">
<img src="images/light.jpg" alt="">
<a class="uk-position-absolute uk-transform-center" style="left: 50%; top: 50%" href="#" uk-marker></a>
</div>
Transform origin
To modify the origin of an animation, like scaling, add one of the uk-transform-origin-*
classes. This can be combined with the Animation component.
Class | Description |
---|---|
.uk-transform-origin-top-left |
The transition originates from the top left. |
.uk-transform-origin-top-center |
The transition originates from the top. |
.uk-transform-origin-top-right |
The transition originates from the top right. |
.uk-transform-origin-center-left |
The transition originates from the left. |
.uk-transform-origin-center-right |
The transition originates from the right. |
.uk-transform-origin-bottom-left |
The transition originates from the bottom left. |
.uk-transform-origin-bottom-center |
The transition originates from the bottom. |
.uk-transform-origin-bottom-right |
The transition originates from the bottom right. |
<div class="uk-transform-origin-bottom-right uk-animation-scale-up"></div>
<div class="uk-child-width-1-3@m" uk-grid>
<div class="uk-animation-toggle" tabindex="0">
<div class="uk-transform-origin-bottom-right uk-card uk-card-default uk-card-body uk-animation-scale-up">
<p class="uk-text-center">Bottom Right</p>
</div>
</div>
<div class="uk-animation-toggle" tabindex="0">
<div class="uk-transform-origin-top-center uk-card uk-card-default uk-card-body uk-animation-scale-up">
<p class="uk-text-center">Top Center</p>
</div>
</div>
<div class="uk-animation-toggle" tabindex="0">
<div class="uk-transform-origin-bottom-center uk-card uk-card-default uk-card-body uk-animation-scale-up">
<p class="uk-text-center">Bottom Center</p>
</div>
</div>
</div>
Disabled
To disable the click behavior of any element, like a <a>
, <button>
or <iframe>
element, add the .uk-disabled
class.
<a class="uk-disabled uk-button uk-button-default" href="#">Disabled</a>
Drag
To apply a move cursor to elements that are being dragged, add the .uk-drag
class.
<div class="uk-drag"></div>
<div class="uk-drag uk-width-small uk-padding uk-background-muted uk-text-center">
<i uk-icon="icon: move; ratio: 2"></i>
</div>
To create a box shadow on an upload area when dragging a file over it, add the .uk-dragover
class.