Custom Cursor Demo
nyxui/custom-cursor-demoFreeExample
Example showing a custom cursor.
Live preview
live · rendered by the registry
Rendered by shadcn/ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://nyxui.com/r/custom-cursor-demo.jsonSource
1"use client";23import { useState } from "react";4import {5 MousePointer2,6 Square,7 Circle,8 Type,9 ImageIcon,10 Hand,11 Minus,12 Plus,13 Share,14 Play,15 ChevronDown,16 ChevronRight,17 Eye,18 Search,19 Layers,20 Palette,21 LucideComponent,22 Zap,23 Menu,24 Settings,25} from "lucide-react";26import { Button } from "@/components/ui/button";27import { Input } from "@/components/ui/input";28import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";29import { Separator } from "@/components/ui/separator";30import { Badge } from "@/components/ui/badge";31import { Sheet, SheetContent, SheetTrigger } from "@/components/ui/sheet";32import { Cursor } from "../ui/custom-cursor";33import Image from "next/image";3435export default function CustomCursorDemo() {36 const [selectedTool, setSelectedTool] = useState("pointer");37 const [selectedLayer, setSelectedLayer] = useState("button");38 const [leftSidebarOpen, setLeftSidebarOpen] = useState(false);39 const [rightSidebarOpen, setRightSidebarOpen] = useState(false);4041 // State for all input values42 const [cornerRadius, setCornerRadius] = useState("8");43 const [opacity, setOpacity] = useState("100%");44 const [fontSize, setFontSize] = useState("16");45 const [fontWeight, setFontWeight] = useState("500");46 const [width, setWidth] = useState("192");47 const [height, setHeight] = useState("48");48 const [xPosition, setXPosition] = useState("91");49 const [yPosition, setYPosition] = useState("680");5051 const tools = [52 { id: "pointer", icon: MousePointer2, label: "Move" },53 { id: "hand", icon: Hand, label: "Hand" },54 { id: "rectangle", icon: Square, label: "Rectangle" },55 { id: "ellipse", icon: Circle, label: "Ellipse" },56 { id: "text", icon: Type, label: "Text" },57 { id: "image", icon: ImageIcon, label: "Image" },58 ];5960 // Custom SVG icons for different tools61 const getToolCursor = (toolId: string) => {62 const toolCursors = {63 pointer: {64 svg: <MousePointer2 className="w-4 h-4" />,65 name: "Select",66 color: "blue",67 },68 hand: {69 svg: <Hand className="w-4 h-4" />,70 name: "Pan",71 color: "green",72 },73 rectangle: {74 svg: <Square className="w-4 h-4" />,75 name: "Rectangle",76 color: "purple",77 },78 ellipse: {79 svg: <Circle className="w-4 h-4" />,80 name: "Ellipse",81 color: "pink",82 },83 text: {84 svg: <Type className="w-4 h-4" />,85 name: "Text",86// … truncated
What it pulls in
Other registry items
Files it writes
More from shadcn/ui
All 68 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| 3D Layered Card Demo3d-layered-card-demo | shadcn/ui | Examples | Free | no deps | |
| Animated Code Block Demoanimated-code-block-demo | shadcn/ui | Examples | Free | no deps | |
| Animated Grainy Background Demoanimated-grainy-bg-demo | shadcn/ui | Examples | Free | no deps | |
| Animated Text Demoanimated-text-demo | shadcn/ui | Examples | Free | no deps | |
| Apple Glass Effect Demoapple-glass-effect-demo | shadcn/ui | Examples | Free | no deps | |
| Bubble Background Demobubble-background-demo | shadcn/ui | Examples | Free | no deps | |
| Cyberpunk Card Democyberpunk-card-demo | shadcn/ui | Examples | Free | no deps | |
| Cyberpunk Card Demo 1cyberpunk-card-demo1 | shadcn/ui | Examples | Free | no deps |
