DocumentationCircle Menu

Circle Menu

A radial navigation menu that expands in a circular pattern with smooth spring animations and hover effects.

Install using CLI

npx shadcn@latest add "https://obsidianui.dev/r/circle-menu.json"

Install Manually

1

Install dependencies

npm install framer-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/ui/circle-menu.tsx

Usage

1import { CircleMenu } from "@/components/ui/circle-menu"
2import { Home, User, Settings, Mail, Heart } from "lucide-react"
3
4export function Demo() {
5return (
6 <CircleMenu
7 items={[
8 { label: "Home", icon: <Home size={18} />, href: "/" },
9 { label: "User", icon: <User size={18} />, href: "/profile" },
10 { label: "Settings", icon: <Settings size={18} />, href: "/settings" }
11 ]}
12 />
13)
14}

Props

Prop NameTypeDefaultDescription
items{ label, icon, href?, onClick? }[]-Array of menu items
openIconReact.ReactNode<Menu />Icon when closed
closeIconReact.ReactNode<X />Icon when open