Components
A macOS-style dock navigation where icons magnify on hover, with a separate collapsible menu on mobile.
Loading preview...
import React from "react";
import { FloatingDock } from "@/components/ui/floating-dock";
import {
IconBrandGithub,
IconBrandX,
IconExchange,
IconHome,
IconNewSection,
IconTerminal2,
} from "@tabler/icons-react";
export default function FloatingDockDemo() {
const links = [
{
title: "Home",
icon: (
<IconHome className="h-full w-full text-neutral-500 dark:text-neutral-300" />
),
href: "#",
},
{
title: "Products",
icon: (
<IconTerminal2 className="h-full w-full text-neutral-500 dark:text-neutral-300" />
),
href: "#",
},
{
title: "Components",
icon: (
<IconNewSection className="h-full w-full text-neutral-500 dark:text-neutral-300" />
),
href: "#",
},
{
title: "Aceternity UI",
icon: (
<img
src="https://assets.aceternity.com/logo-dark.png"
width={20}
height={20}
alt="Aceternity Logo"
/>
),
href: "#",
},
{
title: "Changelog",
icon: (
<IconExchange className="h-full w-full text-neutral-500 dark:text-neutral-300" />
),
href: "#",
},
{
title: "Twitter",
icon: (
<IconBrandX className="h-full w-full text-neutral-500 dark:text-neutral-300" />
),
href: "#",
},
{
title: "GitHub",
icon: (
<IconBrandGithub className="h-full w-full text-neutral-500 dark:text-neutral-300" />
),
href: "#",
},
];
return (
<div className="flex h-[35rem] w-full items-center justify-center">
<FloatingDock mobileClassName="translate-y-20" items={links} />
</div>
);
}