BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn/ui/sidebar

sidebar

showcase-elevenlabs/sidebar
FreeComponent

shadcn/ui publishes no description for this item.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/elevenlabs/showcase/main/apps/www/public/r/styles/new-york/sidebar.json

Source

ui/sidebar.tsxraw.githubusercontent.com/elevenlabs/showcase/main/apps/www/public/r/styles/new-york/sidebar.json · first 6 KB
1"use client"
2
3import * as React from "react"
4import { Slot } from "@radix-ui/react-slot"
5import { VariantProps, cva } from "class-variance-authority"
6import { PanelLeft } from "lucide-react"
7
8import { useIsMobile } from "@/registry/new-york/hooks/use-mobile"
9import { cn } from "@/registry/new-york/lib/utils"
10import { Button } from "@/registry/new-york/ui/button"
11import { Input } from "@/registry/new-york/ui/input"
12import { Separator } from "@/registry/new-york/ui/separator"
13import {
14 Sheet,
15 SheetContent,
16 SheetDescription,
17 SheetHeader,
18 SheetTitle,
19} from "@/registry/new-york/ui/sheet"
20import { Skeleton } from "@/registry/new-york/ui/skeleton"
21import {
22 Tooltip,
23 TooltipContent,
24 TooltipProvider,
25 TooltipTrigger,
26} from "@/registry/new-york/ui/tooltip"
27
28const SIDEBAR_COOKIE_NAME = "sidebar_state"
29const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
30const SIDEBAR_WIDTH = "16rem"
31const SIDEBAR_WIDTH_MOBILE = "18rem"
32const SIDEBAR_WIDTH_ICON = "3rem"
33const SIDEBAR_KEYBOARD_SHORTCUT = "b"
34
35type SidebarContextProps = {
36 state: "expanded" | "collapsed"
37 open: boolean
38 setOpen: (open: boolean) => void
39 openMobile: boolean
40 setOpenMobile: (open: boolean) => void
41 isMobile: boolean
42 toggleSidebar: () => void
43}
44
45const SidebarContext = React.createContext<SidebarContextProps | null>(null)
46
47function useSidebar() {
48 const context = React.useContext(SidebarContext)
49 if (!context) {
50 throw new Error("useSidebar must be used within a SidebarProvider.")
51 }
52
53 return context
54}
55
56const SidebarProvider = React.forwardRef<
57 HTMLDivElement,
58 React.ComponentProps<"div"> & {
59 defaultOpen?: boolean
60 open?: boolean
61 onOpenChange?: (open: boolean) => void
62 }
63>(
64 (
65 {
66 defaultOpen = true,
67 open: openProp,
68 onOpenChange: setOpenProp,
69 className,
70 style,
71 children,
72 ...props
73 },
74 ref
75 ) => {
76 const isMobile = useIsMobile()
77 const [openMobile, setOpenMobile] = React.useState(false)
78
79 // This is the internal state of the sidebar.
80 // We use openProp and setOpenProp for control from outside the component.
81 const [_open, _setOpen] = React.useState(defaultOpen)
82 const open = openProp ?? _open
83 const setOpen = React.useCallback(
84 (value: boolean | ((value: boolean) => boolean)) => {
85 const openState = typeof value === "function" ? value(open) : value
86 if (setOpenProp) {
87 setOpenProp(openState)
88 } else {
89 _setOpen(openState)
90 }
91
92// … truncated

What it pulls in

npm packages

  • @radix-ui/react-slot
  • class-variance-authority
  • lucide-react

Other registry items

  • button
  • separator
  • sheet
  • tooltip
  • input
  • use-mobile
  • skeleton

Files it writes

  • registry/new-york/ui/sidebar.tsx

Facts

Registry
shadcn/ui
Type
registry:ui
Access
Free
Files written
1
Theme wiring
ships cssVars
Licence
the repository states none
In the index
at or before 2026-08-12
Last confirmed
today

Go to the source

showcase.elevenlabs.io elevenlabs/showcase on GitHub Raw registry item This item as JSON

More from shadcn/ui

All 357 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
accordionaccordionshadcn/uiComponentsFree1 dep
alertalertshadcn/uiComponentsFreeno deps
alert-dialogalert-dialogshadcn/uiComponentsFree1 dep
aspect-ratioaspect-ratioshadcn/uiComponentsFree1 dep
avataravatarshadcn/uiComponentsFree1 dep
badgebadgeshadcn/uiComponentsFree1 dep
breadcrumbbreadcrumbshadcn/uiComponentsFree1 dep
buttonbuttonshadcn/uiComponentsFree1 dep

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex