This component no longer exists. It was in ondo-ui’s manifest when we first indexed it and is not there now — the registry served its inventory on 2026-08-09 and this item was not on it. The install command below will fail. It is kept here because a tutorial somewhere still tells people to run it.
sidebar
ondo-ui/sidebarRemovedComponent
A composable, themeable and customizable sidebar component.
Install it
npx shadcn@latest add https://ui.ondo.dou.so/r/sidebar.jsonSource
1"use client"23import * as React from "react"4import { mergeProps } from "@base-ui/react/merge-props"5import { useRender } from "@base-ui/react/use-render"6import { cva, type VariantProps } from "class-variance-authority"78import { useIsMobile } from "@/hooks/use-mobile"9import { cn } from "@/lib/utils"10import { Button } from "@/components/ui/button"11import { Input } from "@/components/ui/input"12import { Separator } from "@/components/ui/separator"13import {14 Sheet,15 SheetContent,16 SheetDescription,17 SheetHeader,18 SheetTitle,19} from "@/components/ui/sheet"20import { Skeleton } from "@/components/ui/skeleton"21import {22 Tooltip,23 TooltipContent,24 TooltipTrigger,25} from "@/components/ui/tooltip"26import { IconLayoutSidebar } from "@tabler/icons-react"2728const SIDEBAR_COOKIE_NAME = "sidebar_state"29const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 730const SIDEBAR_WIDTH = "16rem"31const SIDEBAR_WIDTH_MOBILE = "18rem"32const SIDEBAR_WIDTH_ICON = "3rem"33const SIDEBAR_KEYBOARD_SHORTCUT = "b"3435type SidebarContextProps = {36 state: "expanded" | "collapsed"37 open: boolean38 setOpen: (open: boolean) => void39 openMobile: boolean40 setOpenMobile: (open: boolean) => void41 isMobile: boolean42 toggleSidebar: () => void43}4445const SidebarContext = React.createContext<SidebarContextProps | null>(null)4647function useSidebar() {48 const context = React.useContext(SidebarContext)49 if (!context) {50 throw new Error("useSidebar must be used within a SidebarProvider.")51 }5253 return context54}5556function SidebarProvider({57 defaultOpen = true,58 open: openProp,59 onOpenChange: setOpenProp,60 className,61 style,62 children,63 ...props64}: React.ComponentProps<"div"> & {65 defaultOpen?: boolean66 open?: boolean67 onOpenChange?: (open: boolean) => void68}) {69 const isMobile = useIsMobile()70 const [openMobile, setOpenMobile] = React.useState(false)7172 // This is the internal state of the sidebar.73 // We use openProp and setOpenProp for control from outside the component.74 const [_open, _setOpen] = React.useState(defaultOpen)75 const open = openProp ?? _open76 const setOpen = React.useCallback(77 (value: boolean | ((value: boolean) => boolean)) => {78 const openState = typeof value === "function" ? value(open) : value79 if (setOpenProp) {80 setOpenProp(openState)81 } else {82 _setOpen(openState)83 }8485 // This sets the cookie to keep the sidebar state.86// … truncated
What it pulls in
npm packages
Other registry items
