8-bit Resizable Panel
8bitcn/resizableFreeComponent
Accessible resizable panel groups and layouts with keyboard support.
Install it
npx shadcn@latest add https://www.8bitcn.com/r/resizable.jsonSource
1"use client";23import * as ResizablePrimitive from "react-resizable-panels";45import { cn } from "@/lib/utils";67const ResizablePanelGroup = ({8 className,9 children,10 ...props11}: React.ComponentProps<typeof ResizablePrimitive.Group>) => (12 <div className={cn("w-full h-full relative", className)}>13 <ResizablePrimitive.Group14 className={cn(15 "flex h-full w-full data-[panel-group-direction=vertical]:flex-col"16 )}17 {...props}18 >19 {children}20 <div className="absolute top-0 left-0 w-full h-1.5 bg-foreground dark:bg-ring pointer-events-none" />21 <div className="absolute bottom-0 w-full h-1.5 bg-foreground dark:bg-ring pointer-events-none" />22 <div className="absolute top-1 -left-1 w-1.5 h-1/2 bg-foreground dark:bg-ring pointer-events-none" />23 <div className="absolute bottom-1 -left-1 w-1.5 h-1/2 bg-foreground dark:bg-ring pointer-events-none" />24 <div className="absolute top-1 -right-1 w-1.5 h-1/2 bg-foreground dark:bg-ring pointer-events-none" />25 <div className="absolute bottom-1 -right-1 w-1.5 h-1/2 bg-foreground dark:bg-ring pointer-events-none" />26 </ResizablePrimitive.Group>27 </div>28);2930function ResizablePanel({31 className,32 children,33 ...props34}: React.ComponentProps<typeof ResizablePrimitive.Panel>) {35 return (36 <ResizablePrimitive.Panel className={cn(className)} {...props}>37 {children}38 </ResizablePrimitive.Panel>39 );40}4142const ResizableHandle = ({43 withHandle,44 className,45 ...props46}: React.ComponentProps<typeof ResizablePrimitive.Separator> & {47 withHandle?: boolean;48}) => (49 <ResizablePrimitive.Separator50 className={cn(51 `relative flex w-[1px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-[6px] data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90 focus:dark:outline-ring`,52 "bg-foreground dark:bg-ring",53 className54 )}55 {...props}56 >57// … truncated
Files it writes
More from 8bitcn
All 121 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| 8-bit Accordionaccordion | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Alertalert | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Alert Dialogalert-dialog | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Avataravatar | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Badgebadge | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Breadcrumbbreadcrumb | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Buttonbutton | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Button Groupbutton-group | 8bitcn | Components | Free | no deps · 4 files |
