Winnie CSS
  1. Primitives
  2. navigation

navigation

Provides users the ability to navigate an application.

Import

Import just the navigation styles.

@import "@winnie-ui/css/spatial/navigation";
@import "@winnie-ui/css/visual/navigation";

Anatomy

Attach the appropriate data attributes in the structure below.

<ul data-component="navigation">
<li>
<a data-component="navigation-item">
<i data-slot="icon" />
<span data-slot="label" />
</a>
</li>
<ul data-component="navigation-group">
<li>
<a data-component="navigation-item">
<i data-slot="icon" />
<span data-slot="label" />
<button data-slot="action" />
</a>
</li>
</ul>
<li>
<div data-component="navigation-item">
<i data-slot="icon" />
<span data-slot="label" />
<button data-slot="action" />
</div>
<ul data-component="navigation-group">
<li>
<a data-component="navigation-item">
<i data-slot="icon" />
<span data-slot="label" />
<button data-slot="action" />
</a>
</li>
</ul>
</li>
</ul>

Examples

Radius

Use the data-radius attribute to change the radius.

Icon

Add an icon with the icon slot attribute as a child of the navigation item.

Action

Add an action with the action slot attribute as a child of the navigation item.

Group

Add a group with the navigation-group component.

Disabled

Use the data-disabled or aria-disabled attributes to mark a navigation item as disabled.

Current

Use the data-current or aria-current attributes to identify the current pages’ navigation item.

Reference

navigation-item

Groups all of the parts of the item together.

AttributeValue
data-radius"none" | "sm" | "md" | "lg" | "round"
data-disabledboolean
data-currentboolean
ModifierDescription
hoveredWhen the navigation item is hovered with a mouse
pressedWhen the navigation item is pressed with a mouse or keyboard
disabledWhen the navigation item prevents user interaction
currentWhen the navigation item represents the current page in the application
Variable
--wui-navigation-item-background-<?modifier>
--wui-navigation-item-border-<?modifier>
--wui-navigation-item-color-<?modifier>
--wui-navigation-item-font-weight