Resizable
blok/resizableFreeComponent
Accessible resizable panel groups and layouts with keyboard support.
Install it
npx shadcn@latest add https://blok.sitecore.com/r/resizable.jsonSource
1"use client";23import { Icon } from "@/lib/icon";4import { mdiDragVertical } from "@mdi/js";5import type * as React from "react";6import * as ResizablePrimitive from "react-resizable-panels";78import { cn } from "@/lib/utils";910function ResizablePanelGroup({11 className,12 ...props13}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) {14 return (15 <ResizablePrimitive.PanelGroup16 data-slot="resizable-panel-group"17 className={cn(18 "flex h-full w-full data-[panel-group-direction=vertical]:flex-col",19 className,20 )}21 {...props}22 />23 );24}2526function ResizablePanel({27 ...props28}: React.ComponentProps<typeof ResizablePrimitive.Panel>) {29 return <ResizablePrimitive.Panel data-slot="resizable-panel" {...props} />;30}3132function ResizableHandle({33 withHandle,34 className,35 ...props36}: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {37 withHandle?: boolean;38}) {39 return (40 <ResizablePrimitive.PanelResizeHandle41 data-slot="resizable-handle"42 className={cn(43 "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",44 className,45 )}46 {...props}47 >48 {withHandle && (49 <div className="bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border">50 <Icon path={mdiDragVertical} size={1} className="size-2.5" />51 </div>52 )}53 </ResizablePrimitive.PanelResizeHandle>54 );55}5657export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
What it pulls in
npm packages
Other registry items
Files it writes
More from blok
All 72 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | blok | Components | Free | 2 deps · 2 files | |
| Action baraction-bar | blok | Components | Free | 1 dep · 2 files | |
| Alertalert | blok | Components | Free | 2 deps · 2 files | |
| Alert dialogalert-dialog | blok | Components | Free | 2 deps | |
| Aspect ratioaspect-ratio | blok | Components | Free | 1 dep | |
| Avataravatar | blok | Components | Free | 1 dep | |
| Badgebadge | blok | Components | Free | 2 deps | |
| All componentsblok-components | blok | Components | Free | no deps |
