Skip to content
Kimenpre-v1documentation home
Color scheme

ki-mobile-nav

Use MobileNav for the main destinations of a phone layout. Use buttons for actions. Switch to the app’s TopNav or Sidebar at the same breakpoint you use for the wider layout. For more than five destinations, use a navigation pattern with room for the full set.

App shell

Place one bar after the content in the app shell. Its host reserves the bar’s height and bottom inset so the last content can scroll clear. The default fixed variant spans the bottom edge. Set variant="floating" for an inset raised bar. Both variants account for the bottom safe area. Use viewport-fit=cover in the page’s viewport metadata when drawing edge to edge.

Register the icons used by each destination.

import '@kimen/elements/icons/house';
import '@kimen/elements/icons/search';
import '@kimen/elements/icons/inbox';
<main>
<!-- App content -->
</main>
<ki-mobile-nav label="Main" variant="floating">
<ki-mobile-nav-item href="/" icon-name="house" current>Home</ki-mobile-nav-item>
<ki-mobile-nav-item href="/search" icon-name="search">Search</ki-mobile-nav-item>
<ki-mobile-nav-item href="/inbox" icon-name="inbox" count="3">Inbox</ki-mobile-nav-item>
</ki-mobile-nav>

Accessibility

Use a unique landmark label when several navigation landmarks appear on the page. Keep each destination’s text short and visible, and update current as the route changes. Each item is a native link in the Tab order. When the browser reports or exposes the software keyboard through viewport geometry, the bar temporarily hides.

API reference

When to use: Place after the main content of a narrow layout. Supply three to five direct ki-mobile-nav-item children and mark the current page on its item. The host reserves room for the bar in normal flow.

When not to use: Use buttons for actions. Use TopNav or Sidebar on wide layouts or when there are more than five destinations.

Properties & attributes

AttributePropertyTypeDefaultDescription
labellabelstring'Main'Accessible name of the landmark. Supply a distinct name when the page has more than one navigation landmark.
variantvariant"fixed" | "floating"'fixed'Place the bar edge to edge or inset it as a raised pill.

Slots

SlotDescription
(default)Three to five direct ki-mobile-nav-item destinations.

CSS parts

PartDescription
barThe native navigation landmark and painted bar.

CSS custom properties

The public styling contract of ki-mobile-nav: reassign these tokens at :root or on a subtree — never override internals.

TokenDescription
--ki-mobile-nav-backdrop-filterComplete optional backdrop filter for either bar variant.
--ki-mobile-nav-bgFixed bar surface.
--ki-mobile-nav-bg-imageOptional decorative image for either bar variant.
--ki-mobile-nav-borderStroke along the fixed bar or around the floating bar.
--ki-mobile-nav-border-widthBar border width.
--ki-mobile-nav-floating-bgFloating bar surface.
--ki-mobile-nav-floating-insetSpace beside and below the floating bar.
--ki-mobile-nav-floating-paddingInline padding inside the floating bar.
--ki-mobile-nav-floating-radiusFloating bar pill shape.
--ki-mobile-nav-floating-shadowElevation of the floating bar.
--ki-mobile-nav-font-familyTypeface for the bar and its destination labels.
--ki-mobile-nav-heightMinimum height before the safe area and border are added.
--ki-mobile-nav-item-target-minMinimum block and inline link target size.

Workshop

Open MobileNav in Storybook