Bottom Navigation

A bottom bar with a gliding highlight that recedes on scroll.

bottom-navigation.tsx

Installation

1

Install the packages

npm install @prequelui/react motion

@prequelui/react reuses the primitive library your components already depend on.

2

Add the component

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/bottom-navigation.json

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/bottom-navigation.json

3

Turn on the motion

npx @prequelui/cli@latest animate bottom-navigation

The CLI finds the component through components.json, swaps the import and removes the CSS animation classes that Motion replaces.

Usage

Import the component and compose it exactly like the primitive it wraps. Motion is enabled by default; the tempo prop scales every duration and softens every spring.

bottom-navigation.tsx
import {
  BottomNavigation,
  BottomNavigationItem,
} from "@/components/prequelui/bottom-navigation";
import { Home, Compass, Bell, User } from "lucide-react";

export default function Demo() {
  return (
    <BottomNavigation defaultValue="home">
      <BottomNavigationItem value="home" label="Home" icon={<Home />} />
      <BottomNavigationItem value="explore" label="Explore" icon={<Compass />} />
      <BottomNavigationItem value="alerts" label="Alerts" icon={<Bell />} />
      <BottomNavigationItem value="you" label="You" icon={<User />} />
    </BottomNavigation>
  );
}
import { BottomNavigation } from "@/components/prequelui/bottom-navigation";

export function Variant() {
  return (
    <BottomNavigation tempo={1.2}>
      …
    </BottomNavigation>
  );
}

Animation

One highlight is shared by every item, so switching sections slides the same surface instead of fading one out and another in. Scrolling down lets the bar recede; scrolling up brings it back.

  • Highlight spring: 300 / 30 on position and size.
  • Recede: the bar translates by 110% on the same spring family.
  • Touch and keyboard selection both retarget the shared node.
  • `hideOnScroll` can be turned off when the bar is inline.
  • Reduced motion removes the slide and keeps the colour state.
spring 300 / 30shared highlightrecede 110%scroll aware

API Reference

Each part accepts the usual HTML props in addition to the motion props below. No accessibility prop is hidden behind the animation layer.

BottomNavigation

PropTypeDefault
valuestring—
defaultValuestring""
onValueChange(value: string) => void—
hideOnScrollbooleanfalse
classNamestring—

BottomNavigationItem

PropTypeDefault
valuestring—
labelstring—
iconReactNode—
classNamestring—

Built by Vidhal. The source is available on GitHub.

Last updated: 11/17/2026