Saltar al contenido
El Muestrario

componente · @solu30/ui-kit/navigation

MobileBottomNav

Barra de navegación fija al pie en móvil, con badges y un botón de más que abre un panel.

Seguir leyendo — 3 párrafos más

MobileBottomNav renders a fixed iOS/Android-style bottom navigation bar.

Features:

  • Fixed to viewport bottom with safe-area inset support
  • Hidden on md+ breakpoints (mobile-only)
  • Active pill background on selected item
  • Badge support (any React node)
  • "More" overflow slot with Sheet bottom overlay
  • renderLink for framework-agnostic SPA navigation (Next.js Link, etc.)
  • Touch-friendly targets (min 48px)
  • motion-safe:active:scale-[0.96] press feedback
  • WCAG 2.1: role="navigation", aria-current="page" on active items
  • Adaptive layout by tab count (1-4 flex | 5 compact text | 6+ horizontal scroll)
  • Scroll gradient chevron indicators when tabs overflow
  • animatedIndicator prop: barra superior que se desliza entre tabs, en CSS
  • currentPath prop: URL-based active state from href matching
  • leadingAction prop: leading ReactNode slot (back button, menu toggle, etc.)

Theming via CSS variables (resolved by each vertical's theme):

  • --ui-bg-raised / bg-container: nav background
  • --ui-border: top border color
  • --ui-accent / text-primary: active label + pill color
  • --ui-content-muted / text-content/60: inactive label

4 sitios de import en 3 de 15 verticales — un archivo que la importa cuenta una vez, monte una instancia o veinte.

  • carlosmartinpavon
  • gestorsalon
  • raquetea

La pieza, con lugar de pantalla

Cargando el espécimen…

Cómo se usa

import { MobileBottomNav } from '@solu30/ui-kit/navigation'

Props

10 props declaradas en los tipos de la versión instalada.
PropRequeridaTipoQué hace
itemssíMobileBottomNavItem[]Primary navigation items
moreLabelopcionalstringLabel for the "More" overflow button. If omitted, no more button is shown.
moreActiveopcionalbooleanWhether the "More" button should appear active
moreContentopcionalReact__default.ReactNodeContent rendered inside the "More" bottom sheet (vertical-specific)
moreTitleopcionalstringTitle for the more sheet
renderLinkopcional(props: { href: string; className: string; children: React__default.ReactNode; 'aria-current'?: 'page'; }) => React__default.ReactNodeCustom link renderer for framework integration (Next.js Link, etc.)
currentPathopcionalstringCurrent URL path for auto-detecting active state via href matching. When provided, a tab with `href` is considered active if `currentPath === href` or `currentPath.startsWith(href + '/')`. Explicit `item.active` takes precedence over path matching.
leadingActionopcionalReact__default.ReactNodeLeading action slot — rendered to the left of the tab strip, separated by a vertical divider (e.g., back button or menu toggle).
animatedIndicatoropcionalbooleanWhen `true`, renders a top-bar indicator that slides between active tabs. ADR-341 — era un `layoutId` de framer-motion cargado con un `require()` dinámico para que el bundle se pudiera tree-shakear cuando la prop no se usaba. Ahora es CSS, así que no hay nada que tree-shakear ni peer que resolver: la prop sigue existiendo porque sigue siendo una decisión de diseño —hay barras de navegación donde la marca que viaja distrae— y no porque cueste algo tenerla prendida. De paso arregla un defecto que el `layoutId` traía: era la constante `"mobileBottomNavActiveIndicator"`, la MISMA para todas las instancias, así que dos navs montadas a la vez se peleaban el mismo indicador. El de ahora es por instancia por construcción. @default false
classNameopcionalstring—