Subnav

Defines different styles for a sub navigation.

Table of contents

Usage

To apply this component, use the following classes. To align a subnav, for example to horizontally center it, you can use utility classes from Tailwind CSS.

ClassDescription
.uk-subnavAdd this class to a <ul> element to define the Subnav component. Use <a> elements as nav items within the list.
.uk-active Add this class to a list item to apply an active state.

To add list items without a link, use a <span> element instead of an <a>. Alternatively, disable an <a> element by adding the .uk-disabled class to the <li> element and remove the href attribute from the anchor to make it inaccessible through keyboard navigation.

Style modifiers

Add one of the following classes for additional styles.

ClassDescription
.uk-subnav-primaryAdds a primary style.
.uk-subnav-secondaryAdds a secondary style.
.uk-subnav-destructiveAdds a destructive style.

You can also use a dropdown from the Dropdown component with a subnav.

Customize

Customize your Franken UI experience.