Navigation
FloatingNavbar
Pill-shaped floating navbar that hides on scroll-down and reappears on scroll-up.
Interactive Preview
↓ Scroll down to hide / scroll up to reveal
Content block 1
Content block 2
Content block 3
Content block 4
Content block 5
Content block 6
Content block 7
Content block 8
Content block 9
Content block 10
Fixed positioning in production: FloatingNavbar ใช้ position: fixed เวลาใช้จริงให้วางที่ root layout เพื่อให้ navbar ลอยเหนือทุก page
Installation
# Copy the component file# src/components/navigation/FloatingNavbar.tsx
Usage
// app/layout.tsximport FloatingNavbar from '@/components/navigation/FloatingNavbar'const links = [{ label: 'Components', href: '/components' },{ label: 'Tracks', href: '/products' },{ label: 'Guidance', href: '/services' },]export default function RootLayout({ children }) {return (<html><body><FloatingNavbarlogo={<span className="font-bold text-primary">Nexus</span>}links={links}cta={{ label: 'Start Learning', href: '/products' }}/>{children}</body></html>)}
Prompt Preview
Copy a prompt that recreates this UI
Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.
Copy-ready AI prompt
Starts from the current visual reference and project constraints.
Tweak only product-specific copy or data after the first generation pass.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
links | NavLinkItem[] | - | Array of {label, href} |
logo | React.ReactNode | - | Logo slot |
cta | { label: string; href: string } | - | Call-to-action button |