Sidebar
poyraz/sidebarFreeComponent
Poyraz Soft Glass Sidebar with container-responsive layout and semantic tokens.
Install it
npx shadcn@latest add https://ui.poyrazavsever.com/r/sidebar.jsonSource
1"use client";23import * as React from "react";4import { cva, type VariantProps } from "class-variance-authority";5import { ChevronDown, PanelLeftClose, PanelLeftOpen, Search, X } from "lucide-react";67import { cn } from "@/lib/utils";8import {9 SidebarProvider,10 useSidebar,11 type SidebarContextValue,12} from "@/components/ui/organisms/sidebar-provider";1314/* ================================================================== */15/* CONTEXT */16/* ================================================================== */1718/* ================================================================== */19/* HELPER: check dark variant */20/* ================================================================== */2122function isDarkVariant(v: SidebarContextValue["variant"]) {23 return v === "dark";24}2526/* ================================================================== */27/* SIDEBAR ROOT */28/* ================================================================== */2930const sidebarVariants = cva(31 [32 "flex flex-col font-sans",33 "transition-[width,transform,opacity] duration-[var(--poyraz-motion-duration-slow)] ease-[var(--poyraz-motion-ease-out)]",34 "h-full",35 ].join(" "),36 {37 variants: {38 variant: {39 default: "w-56 bg-background text-foreground border-r border-border",40 collapsible: "bg-background text-foreground border-r border-border",41 floating:42 "fixed inset-y-0 left-0 z-50 w-64 bg-glass text-foreground border-r border-glass-border-outer backdrop-blur-glass shadow-[var(--poyraz-glass-shadow)]",43 mini: "w-16 bg-background text-foreground border-r border-border",44 dark: "w-56 bg-inverted text-inverted-foreground border-r border-border-strong",45 bordered: "w-56 bg-background text-foreground border border-border-strong",46 inset: "w-56 bg-muted/80 text-foreground border border-border rounded-lg shadow-sm",47 },48 },49 defaultVariants: { variant: "default" },50 },51);5253export interface SidebarProps54 extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof sidebarVariants> {55 /** Start in collapsed state (for collapsible variant) */56 defaultCollapsed?: boolean;57}5859const Sidebar = React.forwardRef<HTMLElement, SidebarProps>(60 ({ className, variant = "default", defaultCollapsed = false, children, ...props }, ref) => (61// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from poyraz
All 71 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | poyraz | Components | Free | 2 deps | |
| Alertalert | poyraz | Components | Free | 2 deps | |
| Announcement Barannouncement-bar | poyraz | Components | Free | 2 deps | |
| Autocompleteautocomplete | poyraz | Components | Free | 1 dep | |
| Avataravatar | poyraz | Components | Free | 2 deps | |
| Badgebadge | poyraz | Components | Free | 1 dep | |
| Bg Patternbg-pattern | poyraz | Components | Free | no deps | |
| Breadcrumbbreadcrumb | poyraz | Components | Free | 1 dep |
