Create a dot navigation to operate slideshows or to scroll to different page sections.
To create a navigation with dots, use the following classes. This component is built with Flexbox. So to align a dotnav, you can use Flex component or utility classes from Tailwind CSS.
| Class | Description |
|---|---|
.uk-dotnav | Add this class to a <ul> element to define the Dotnav component. Use <a> elements as nav items within the list. |
.uk-active | Add this class to a list item to apply an active state. |
<ul class="uk-dotnav">
<li class="uk-active"><a href=""></a></li>
<li><a href=""></a></li>
</ul>
The dotnav can also be displayed vertically. Just add the .uk-dotnav-vertical modifier.
<ul class="uk-dotnav uk-dotnav-vertical">
...
</ul>
On your tailwind.config.js file, add the
Dotnav component within the ui() plugin.
import ui from "franken-ui";
ui({
components: {
dotnav: {
hooks: {}
}
}
}),
Note If you are developing theme from scratch, you can use all these hooks. If you’re using the shadcn/ui theme, some hooks might not work as they were already in use or removed. Learn more about using hooks.
| Hook Name | Affected Classes |
|---|---|
hook-dotnav | .uk-dotnav |
hook-item | .uk-dotnav > * > * |
hook-item-hover | .uk-dotnav > * > :hover |
hook-item-onclick | .uk-dotnav > * > :active |
hook-item-active | .uk-dotnav > .uk-active > * |
hook-misc | * |