BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/neobrutalism/sidebar

sidebar

neobrutalism/sidebar
FreeComponent

neobrutalism publishes no description for this item.

Live preview

live · rendered by the registry
Rendered by neobrutalism on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://neobrutalism.com/r/sidebar.json

Source

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

What it pulls in

npm packages

  • @base-ui/react
  • class-variance-authority
  • lucide-react

Other registry items

  • button
  • input
  • separator
  • sheet
  • skeleton
  • tooltip

Files it writes

  • sidebar.tsx

Facts

Registry
neobrutalism
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-10
Last confirmed
today

Go to the source

Docs on neobrutalism neobrutalism.com neobrutalism/neobrutalism on GitHub Raw registry item This item as JSON

More from neobrutalism

All 54 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
accordionaccordionneobrutalismComponentsFree2 deps
alertalertneobrutalismComponentsFree2 deps
alert-dialogalert-dialogneobrutalismComponentsFree1 dep
aspect-ratioaspect-rationeobrutalismComponentsFree1 dep
avataravatarneobrutalismComponentsFree1 dep
badgebadgeneobrutalismComponentsFree2 deps
breadcrumbbreadcrumbneobrutalismComponentsFree2 deps
buttonbuttonneobrutalismComponentsFree2 deps

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