Skip to content

HyBottombar

Usage examples on this page are written for Lit / plain HTML (<hy-bottombar>). The same component ships as HyBottombar in @whitespaceux/harmony-react (native React 19), with typed wrappers for Angular, Solid, Svelte, and Vue. The API reference below applies to all frameworks.

A responsive bottom navigation bar component for mobile-style navigation.

The bottombar provides a structured container for navigation items at the bottom of an application, typically used for mobile navigation. It renders a semantic <nav> element with role="navigation" for proper accessibility.

Key Features

  • Semantic <nav> element with role="navigation"
  • Centered flexbox layout for navigation items
  • Fixed, sticky, or static positioning
  • Responsive height with CSS custom properties
  • Built-in safe area inset support for notched devices
  • SSR compatible

Accessibility Features

  • Renders semantic <nav role="navigation"> element
  • Proper landmark for screen readers
  • Focus management with visible focus indicators
  • Sets scroll-padding-bottom to prevent focus obscuring behind fixed/sticky bar
  • Uses inert attribute when collapsed to remove from accessibility tree
  • High contrast mode support
  • Forced colors mode support (Windows High Contrast)
  • Reduced motion support
  • Hidden in print styles

Browser Compatibility

  • Modern browsers (Chrome, Firefox, Safari, Edge)
  • SSR support via Lit's isServer

Examples

Basic Usage

html
<hy-bottombar label="Main navigation">
  <hy-icon-button name="home" label="Home"></hy-icon-button>
  <hy-icon-button name="search" label="Search"></hy-icon-button>
  <hy-icon-button name="favorite-border" label="Favorites"></hy-icon-button>
  <hy-icon-button name="lock" label="Account"></hy-icon-button>
</hy-bottombar>

Fixed Position with Elevation

html
<hy-bottombar position="fixed" elevated>
  <hy-icon-button name="home" label="Home"></hy-icon-button>
  <hy-icon-button name="search" label="Search"></hy-icon-button>
  <hy-icon-button name="info" label="Info"></hy-icon-button>
</hy-bottombar>

API

Properties

PropertyAttributeTypeDefaultDescription
positionposition'fixed' | 'sticky' | 'static''fixed'CSS positioning of the bottombar
heightheightstring''Height of the bottombar. Accepts any valid CSS value.
elevatedelevatedbooleanfalseWhether the bottombar has elevation (shadow)
borderedborderedbooleantrueWhether the bottombar has a top border
collapsedcollapsedbooleanfalseWhether the bottombar is collapsed/hidden
labellabelstring''Accessible label for the bottombar

Slots

SlotDescription
defaultNavigation items (typically icon buttons)

CSS Parts

PartDescription
baseThe component's base wrapper element (the <nav>)
containerThe inner container for content alignment

CSS Custom Properties

PropertyDescription
--hy-bottombar-heightHeight of the bottombar (default: --hy-surface-height-md)
--hy-bottombar-background-surface-elevationBackground color. Default: --hy-background-surface-elevation-2 (same as surface-base in light mode; lifts in dark mode for OLED-true-black visibility)
--hy-bottombar-border-default-restTop border color (default: --hy-border-default-rest)
--hy-bottombar-shadow-elevationBox shadow when elevated (default: --hy-shadow-elevation-2-up)
--hy-bottombar-padding-inlineHorizontal padding (default: --hy-padding-shell-inline)
--hy-bottombar-focus-radiusFocus indicator border radius (default: --hy-focus-ring-radius)
--hy-bottombar-gapGap between items (default: --hy-gap-shell-inline)
--hy-bottombar-item-max-widthMaximum width of each item (default: --hy-surface-width-xs)
--hy-bottombar-strokeBorder width for top border
--hy-bottombar-enter-durationTransition duration for the show and hide entrance animation
--hy-bottombar-enter-easingTransition easing for the show and hide entrance animation

Built with Lit. Documented with VitePress.