Circle Menu
A radial navigation menu that expands in a circular pattern with smooth spring animations and hover effects.
Component preview
Install using CLI
npx shadcn@latest add "https://www.obsidianui.dev/r/circle-menu.json"Install Manually
1
Install dependencies
npm install motion lucide-react clsx tailwind-merge
2
Add util file
Create a file lib/utils.ts:
import { ClassValue, clsx } from 'clsx';import { twMerge } from 'tailwind-merge';export function cn(...inputs: ClassValue[]) {return twMerge(clsx(inputs));}
3
Copy the source code
Copy the code into components/block/circle-menu.tsx
Usage
Code
import { CircleMenu } from "@/components/block/circle-menu"import { Home, User, Settings, Mail, Heart } from "lucide-react"export function Demo() {return (<CircleMenuitems={[{ label: "Home", icon: <Home size={18} />, href: "/" },{ label: "User", icon: <User size={18} />, href: "/profile" },{ label: "Settings", icon: <Settings size={18} />, href: "/settings" }]}/>)}
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| items | { label, icon, href?, onClick? }[] | - | Array of menu items |
| openIcon | React.ReactNode | <Menu /> | Icon when closed |
| closeIcon | React.ReactNode | <X /> | Icon when open |
Last updated on