BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/gymnopedies/sidebar

Sidebar

gymnopedies/sidebar
FreeComponent

Sidebar — gymnopédies-themed shadcn primitive.

Install it

npx shadcn@latest add https://gymnopedies.shoota.work/r/sidebar.json

Source

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

What it pulls in

npm packages

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

Other registry items

  • https://gymnopedies.shoota.work/r/utils.json
  • https://gymnopedies.shoota.work/r/use-mobile.json

Files it writes

  • src/components/ui/sidebar.tsx

Facts

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

Go to the source

gymnopedies.shoota.work shoota/gymnopedies on GitHub Raw registry item This item as JSON

More from gymnopedies

All 49 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordiongymnopediesComponentsFree2 deps
AlertalertgymnopediesComponentsFree1 dep
Alert Dialogalert-dialoggymnopediesComponentsFree1 dep
ArticlearticlegymnopediesComponentsFreeno deps
Aspect Ratioaspect-ratiogymnopediesComponentsFreeno deps
AvataravatargymnopediesComponentsFree1 dep
BadgebadgegymnopediesComponentsFree2 deps
BreadcrumbbreadcrumbgymnopediesComponentsFree2 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