resizable
nrjdalal/resizableFreeComponent
acme publishes no description for this item.
Install it
npx shadcn@latest add https://nrjdalal.dev/r/resizable.jsonSource
1"use client"23import { cn } from "@/lib/utils"4import { GripVerticalIcon } from "lucide-react"5import * as React from "react"6import * as ResizablePrimitive from "react-resizable-panels"78function ResizablePanelGroup({9 className,10 ...props11}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) {12 return (13 <ResizablePrimitive.PanelGroup14 data-slot="resizable-panel-group"15 className={cn(16 "flex h-full w-full data-[panel-group-direction=vertical]:flex-col",17 className,18 )}19 {...props}20 />21 )22}2324function ResizablePanel({25 ...props26}: React.ComponentProps<typeof ResizablePrimitive.Panel>) {27 return <ResizablePrimitive.Panel data-slot="resizable-panel" {...props} />28}2930function ResizableHandle({31 withHandle,32 className,33 ...props34}: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {35 withHandle?: boolean36}) {37 return (38 <ResizablePrimitive.PanelResizeHandle39 data-slot="resizable-handle"40 className={cn(41 "bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px 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-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",42 className,43 )}44 {...props}45 >46 {withHandle && (47 <div className="bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border">48 <GripVerticalIcon className="size-2.5" />49 </div>50 )}51 </ResizablePrimitive.PanelResizeHandle>52 )53}5455export { ResizablePanelGroup, ResizablePanel, ResizableHandle }
What it pulls in
npm packages
Files it writes
More from acme
All 49 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | acme | Components | Free | 5 deps · 2 files | |
| alertalert | acme | Components | Free | 4 deps · 2 files | |
| alert-dialogalert-dialog | acme | Components | Free | 6 deps · 3 files | |
| aspect-ratioaspect-ratio | acme | Components | Free | 1 dep | |
| avataravatar | acme | Components | Free | 4 deps · 2 files | |
| badgebadge | acme | Components | Free | 5 deps · 2 files | |
| breadcrumbbreadcrumb | acme | Components | Free | 5 deps · 2 files | |
| buttonbutton | acme | Components | Free | 5 deps · 2 files |
