Aceternity UI components

Created
Feb 9, 2024 4:58 AM
URL
https://ui.aceternity.com/components/floating-navbar
Type

A sticky Navbar that hides on scroll, reveals when scrolled up.

Installation

Install dependencies

npm i framer-motion clsx tailwind-merge

Add util file

utils/cn.ts

import { ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}

Copy the source code

components/ui/floating-navbar.tsx

Props

Prop name
Type
Description
className
string
The class name of the child component.
navItems
{name: string, link: string, icon: ReactNode}
The navigation items you want to render in the navbar