Dakik// Bits
Dakik.co.uk
All bits

// Navigation

Sidebar

A sidebar for navigation and app structure.

// Rendering preview…

// Install

npx shadcn@latest add @dakik/sidebar

// Usage

1import { SidebarProvider, Sidebar, SidebarTrigger, SidebarRail } from "@/components/ui/sidebar";
2
3<SidebarProvider />

// Code

1"use client";
2
3import { ark } from "@ark-ui/react/factory";
4import { PanelLeftIcon } from "lucide-react";
5import React from "react";
6import type { VariantProps } from "tailwind-variants";
7import { cn } from "@/lib/utils";
8import { Button, buttonVariants } from "@/registry/react/components/button";
9import { Input } from "@/registry/react/components/input";
10import { ScrollArea } from "@/registry/react/components/scroll-area";
11import { Separator } from "@/registry/react/components/separator";
12import {
13 Sheet,
14 SheetContent,
15 SheetHeader,
16} from "@/registry/react/components/sheet";
17import { Skeleton } from "@/registry/react/components/skeleton";
18import {
19 Tooltip,
20 TooltipContent,
21 TooltipTrigger,
22} from "@/registry/react/components/tooltip";
23import { useIsMobile } from "@/registry/react/hooks/use-is-mobile";
24
25const SIDEBAR_COOKIE_NAME = "sidebar_state";
26const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
27const SIDEBAR_WIDTH = "16rem";
28const SIDEBAR_WIDTH_MOBILE = "18rem";

// Dependencies