Bottom Menu
uselayouts/bottom-menuFreeComponent
A floating bottom navigation menu with smooth interactions.
Live preview
live · rendered by the registry
Rendered by uselayouts on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://uselayouts.com/r/bottom-menu.jsonSource
1"use client";23import {4 Notification03Icon,5 Search01Icon,6 Sun03Icon,7 Moon02Icon,8 ComputerIcon,9 UserEdit01Icon,10 PlusSignIcon,11 Mic01Icon,12 Camera01Icon,13 PencilEdit02Icon,14 FilterHorizontalIcon,15 AutoConversationsIcon,16} from "@hugeicons/core-free-icons";17import { HugeiconsIcon } from "@hugeicons/react";18import React, { useMemo, useState, useRef, useEffect } from "react";19import { AnimatePresence, motion } from "motion/react";20import useMeasure from "react-use-measure";21import { cn } from "@/lib/utils";2223// Change Here24const MAIN_NAV = [25 { icon: PlusSignIcon, name: "home" },26 { icon: Search01Icon, name: "search" },27 { icon: Notification03Icon, name: "notifications" },28 { icon: UserEdit01Icon, name: "profile" },29 { icon: Sun03Icon, name: "theme" },30];3132const HOME_ITEMS = [33 { icon: PencilEdit02Icon, text: "Note" },34 { icon: Mic01Icon, text: "Voice" },35 { icon: Camera01Icon, text: "Screenshot" },36];3738const SEARCH_OPTIONS = [39 { icon: FilterHorizontalIcon, text: "Filter" },40 { icon: AutoConversationsIcon, text: "Trending" },41];4243const NOTIFICATION_TYPES = ["Messages", "System Alerts"];4445const PROFILE_LINKS = ["My Account", "Settings", "Subscription / Billing"];4647const THEME_OPTIONS = [48 { key: "light", icon: Sun03Icon, text: "Light" },49 { key: "dark", icon: Moon02Icon, text: "Dark" },50 { key: "system", icon: ComputerIcon, text: "System" },51];5253const BottomMenu = () => {54 const containerRef = useRef<HTMLDivElement>(null);55 const [elementRef] = useMeasure();56 const [hiddenRef, hiddenBounds] = useMeasure();57 const [view, setView] = useState<58 "default" | "home" | "search" | "notifications" | "profile" | "theme"59 >("default");6061 // Track selected theme62 const [theme, setTheme] = useState<"light" | "dark" | "system">("light");63 useEffect(() => {64 const handleClickOutside = (event: MouseEvent) => {65 if (66 containerRef.current &&67 !containerRef.current.contains(event.target as Node)68 ) {69 setView("default");70 }71 };7273 document.addEventListener("mousedown", handleClickOutside);74 return () => {75 document.removeEventListener("mousedown", handleClickOutside);76 };77 }, []);7879 const sharedHover =80 "group transition-all duration-75 px-3 py-2 text-[15px] text-muted-foreground w-full text-left rounded-[12px] hover:bg-muted/80 hover:text-foreground";8182 const content = useMemo(() => {83 switch (view) {84 case "default":85 return null;8687 case "home":88// … truncated
What it pulls in
npm packages
Files it writes
More from uselayouts
All 26 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| 3D Book3d-book | uselayouts | Components | Free | 3 deps | |
| Animated Collectionanimated-collection | uselayouts | Components | Free | 5 deps | |
| Bento Cardbento-card | uselayouts | Components | Free | 5 deps | |
| Bucketbucket | uselayouts | Components | Free | 5 deps · 2 files | |
| Day Pickerday-picker | uselayouts | Components | Free | 5 deps | |
| Delete Buttondelete-button | uselayouts | Components | Free | 5 deps | |
| Discover Buttondiscover-button | uselayouts | Components | Free | 5 deps | |
| Discrete Tabsdiscrete-tabs | uselayouts | Components | Free | 3 deps |
