A bottom bar with a gliding highlight that recedes on scroll.
Installation
Install the packages
npm install @prequelui/react motion@prequelui/react reuses the primitive library your components already depend on.
Add the component
npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/bottom-navigation.jsonnpx shadcn@latest add https://animate.prequelui.terravidhal.me/r/bottom-navigation.json
Turn on the motion
npx @prequelui/cli@latest animate bottom-navigationThe 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.
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.
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.