UI components / Navigation
Floating Navbar: a React and Tailwind UI component
A glass pill nav that hides on scroll down and returns on scroll up.
Open the live Floating Navbar preview.
An animated navbar for a compact site header
Use this floating navigation bar when a page needs a compact header that moves out of the way on downward scrolling and returns as the visitor scrolls up. The demo listens to its own scroll panel; your page can use the window or pass a scroll container.
Integration and launch checks
The exported FloatingNavbar accepts links, an optional CTA and an optional scroller ref. Replace the demo logo and anchor targets. Supply real destinations and keep the header inside a layout where sticky positioning can work. This is React + Tailwind source, not a standalone HTML navbar.
- Check that every link has a real destination and a visible keyboard focus state. Keep focused navigation visible; adapt the hide-on-scroll rule if it would hide focus.
- Test short screens and long link labels at phone width. Add a mobile navigation treatment if your link set does not fit.
- Mark the current destination with aria-current when appropriate, and provide a reduced-motion treatment for the translation. These are integration checks, not a claim that every host app meets them.
Related guides
- Animated tabs for in-page content
- React and Tailwind component guide
- Portfolio layouts with a clear contact path
About navigation components
Navigation components need to be predictable above all. Motion should show where you are and where you are going, every item must be reachable by keyboard, and the current page should be marked with aria-current.
Install the Floating Navbar
- Create
components/ui/floating-navbar.tsxin your React + Tailwind project. - Paste the code. It only imports React; keyframes are defined inside the file.
- Import the named component where you need it. The default export is a ready-made demo you can delete.
Frequently asked questions
Is the Floating Navbar component free?
Anyone can open the live preview. Copying the code is included with a Scrollhaus plan.
What do I need to use it?
A React project with Tailwind CSS: Next.js, Vite, Lovable or Bolt. The file only imports React; its animations ship inside the component.
Is it accessible?
Treat this as an implementation starting point. Follow the integration and launch checks below, including keyboard focus, mobile layout and reduced-motion behaviour, and test the component in your app.
More navigation
- Command Palette: ⌘K search over actions with fuzzy matching, keyboard navigation and grouped results.
- Dock Menu: App-dock icons that magnify with distance to the cursor, with tooltips and open dots.
- Sliding Tabs: A pill glides to the active tab, a hover highlight follows the cursor, panels cross-fade.
- Stepper: A multi-step progress header whose line fills as you advance; finished steps turn into checks.
- Collapsible Sidebar: An app sidebar that folds down to icons; labels fade out and tooltips take over.
- Pagination: Page buttons with an active pill, smart ellipses for long ranges, and prev/next.