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, 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.
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
-
<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. |
- RightLeft
-
<div class="uk-clearfix"> <div class="uk-float-right"> <div class="uk-card uk-card-body uk-card-default">Right</div> </div> <div class="uk-float-left"> <div class="uk-card uk-card-body uk-card-default">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.
-
Table Heading Table Heading Table Heading Table Heading Table Heading Table Heading Table Heading Table Heading Table Data Table Data Table Data Table Data Table Data Table Data Table Data Table Data Table Data Table Data Table Data Table Data Table Data Table Data Table Data Table Data Table Footer Table Footer Table Footer Table Footer Table Footer Table Footer Table Footer Table Footer -
<div class="uk-height-small uk-overflow-auto"> <table class="uk-table-condensed uk-table uk-table-striped 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> <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> <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> </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.
-
Some content before the overflow auto container.
Some content after the overflow auto container.
-
<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" width="1800" height="1200" alt="" /> </div> <div class="uk-width-1-2"> <img src="/images/dark.jpg" width="1800" height="1200" alt="" /> </div> <div class="uk-width-1-2"> <img src="/images/photo.jpg" width="1800" height="1200" alt="" /> </div> <div class="uk-width-1-2"> <img src="/images/photo2.jpg" width="1800" height="1200" 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>
- Open
Headline
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.
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.
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.
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.
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.
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.
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.
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.
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.
-
<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-modal-close uk-button uk-button-default" 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 |
---|---|---|---|
sel-container | String | .uk-modal | CSS selector for the container element which provides the height. |
sel-content | 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
-
<!-- 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>
<!-- 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>
-
<div class="uk-child-width-1-2@s" uk-grid> <div> <pre class="uk-overflow-auto 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-overflow-auto 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 src="" width="" height="" alt="" />
<div class="uk-position-cover"></div>
</div>
-
-
<div class="uk-inline"> <img src="/images/photo.jpg" width="300" height="200" alt="" /> <div class="uk-flex uk-flex-center uk-flex-middle uk-overlay uk-overlay-default uk-position-cover uk-position-medium" > 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="" width="" height="" alt="" />
<iframe src="" width="" height="" uk-responsive></iframe>
Object Fit and Position
Define how the content of an image or video should be resized to fit its element.
Class | Description |
---|---|
.uk-object-cover | Scales the image by keeping its aspect ratio to completely cover the content box. |
.uk-object-contain | Scales the image by keeping its aspect ratio as far as its width and height can fit inside the content box. |
.uk-object-fill | Scales the image to fill the element’s content box. |
.uk-object-none | Doesn’t scale the image at all. |
.uk-object-scale-down | Like contain, but never up-scales. |
Note Since images and video are responsive by default in UIkit, it’s mandatory to set the aspect ratio when using one of these classes.
<img
class="uk-object-cover"
src=""
width="1000"
height="1000"
alt=""
style="aspect-ratio: 1 / 1"
/>
-
-
<div class="uk-child-width-1-2@s" uk-grid> <div> <img class="uk-object-cover" src="/images/photo.jpg" width="1000" height="1000" alt="" style="aspect-ratio: 1 / 1" /> </div> <div> <img class="uk-object-contain" src="/images/photo.jpg" width="1000" height="1000" alt="" style="aspect-ratio: 1 / 1" /> </div> </div>
To modify the alignment of the image or video within its element, add one of the uk-object-position-*
classes.
Class | Description |
---|---|
.uk-object-position-top-left | Align to the top left. |
.uk-object-position-top-center | Align to the top. |
.uk-object-position-top-right | Align to the top right. |
.uk-object-position-center-left | Align to the left. |
.uk-object-position-center-center | Align to the center. |
.uk-object-position-center-right | Align to the right. |
.uk-object-position-bottom-left | Align to the bottom left. |
.uk-object-position-bottom-center | Align to the bottom. |
.uk-object-position-bottom-right | Align to the bottom right. |
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. |
-
-
<div class="uk-flex uk-overflow-auto"> <img class="uk-margin-right uk-border-rounded" src="/images/avatar.jpg" width="200" height="200" alt="Border rounded" /> <img class="uk-margin-right 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" /> </div>
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 | Add this class to apply a 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>
- SmallMediumLargeX-Large
-
<div class="uk-child-width-1-2@s uk-text-center" uk-grid> <div> <div class="uk-padding uk-box-shadow-small">Small</div> </div> <div> <div class="uk-padding uk-box-shadow-medium">Medium</div> </div> <div> <div class="uk-padding uk-box-shadow-large">Large</div> </div> <div> <div class="uk-padding uk-box-shadow-xlarge">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>
- Box shadow bottom
-
<div class="uk-width-1-2@s uk-text-center uk-box-shadow-small uk-box-shadow-bottom" > <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>
- Hover SmallHover X-LargeSmall + Hover LargeX-Large + Hover Medium
-
<div class="uk-child-width-1-2@s uk-text-center" uk-grid> <div> <div class="uk-padding uk-box-shadow-hover-small">Hover Small</div> </div> <div> <div class="uk-padding uk-box-shadow-hover-xlarge">Hover X-Large</div> </div> <div> <div class="uk-padding uk-box-shadow-small uk-box-shadow-hover-large"> Small + Hover Large </div> </div> <div> <div class="uk-padding uk-box-shadow-xlarge uk-box-shadow-hover-medium"> 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.
-
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 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>
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-overlay uk-overlay-primary uk-blend-multiply"></div>
<img src="" width="" height="" alt="" />
</div>
-
Multiply
Screen
Overlay
Darken
Lighten
Color Dodge
Color Burn
Hard Light
Soft Light
Difference
Exclusion
Hue
Saturation
Color
Luminosity
-
<div class="uk-child-width-1-3@s uk-grid-small uk-child-width-1-2" uk-grid> <div> <div class="uk-inline uk-background-primary"> <img class="uk-blend-multiply" src="/images/dark.jpg" width="1800" height="1200" 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" width="1800" height="1200" 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" width="1800" height="1200" 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" width="1800" height="1200" 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" width="1800" height="1200" 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" width="1800" height="1200" 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" width="1800" height="1200" 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" width="1800" height="1200" 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" width="1800" height="1200" 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" width="1800" height="1200" 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" width="1800" height="1200" 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" width="1800" height="1200" 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" width="1800" height="1200" 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" width="1800" height="1200" 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" width="1800" height="1200" 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" width="1800" height="1200" 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-animation-scale-up uk-transform-origin-bottom-right"></div>
-
Bottom Right
Top Center
Bottom Center
-
<div class="uk-child-width-1-3@m" uk-grid> <div class="uk-animation-toggle" tabindex="0"> <div class="uk-animation-scale-up uk-card uk-card-body uk-card-default uk-transform-origin-bottom-right" > <p class="uk-text-center">Bottom Right</p> </div> </div> <div class="uk-animation-toggle" tabindex="0"> <div class="uk-animation-scale-up uk-card uk-card-body uk-card-default uk-transform-origin-top-center" > <p class="uk-text-center">Top Center</p> </div> </div> <div class="uk-animation-toggle" tabindex="0"> <div class="uk-animation-scale-up uk-card uk-card-body uk-card-default uk-transform-origin-bottom-center" > <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-background-muted uk-padding uk-text-center uk-drag uk-width-small" > <uk-icon icon="move"></uk-icon> </div>
To create a box shadow on an upload area when dragging a file over it, add the .uk-dragover
class.