Resizable
nswds-ui/resizableFreeComponent
Resizable panel groups with draggable handles, built on react-resizable-panels.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/digitalnsw/nswds-ui/main/apps/registry/public/r/resizable.jsonSource
1'use client'23import * as ResizablePrimitive from 'react-resizable-panels'45import { cn } from '@/lib/utils'67function ResizablePanelGroup({ className, ...props }: ResizablePrimitive.GroupProps) {8 return (9 <ResizablePrimitive.Group10 data-slot='resizable-panel-group'11 className={cn('flex h-full w-full aria-[orientation=vertical]:flex-col', className)}12 {...props}13 />14 )15}1617function ResizablePanel({ ...props }: ResizablePrimitive.PanelProps) {18 return <ResizablePrimitive.Panel data-slot='resizable-panel' {...props} />19}2021function ResizableHandle({22 withHandle,23 className,24 ...props25}: ResizablePrimitive.SeparatorProps & {26 withHandle?: boolean27}) {28 return (29 <ResizablePrimitive.Separator30 data-slot='resizable-handle'31 className={cn(32 'relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:start-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:start-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 rtl:after:translate-x-1/2 rtl:aria-[orientation=horizontal]:after:-translate-x-0 [&[aria-orientation=horizontal]>div]:rotate-90',33 className,34 )}35 {...props}36 >37 {withHandle && <div className='z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border' />}38 </ResizablePrimitive.Separator>39 )40}4142export { ResizableHandle, ResizablePanel, ResizablePanelGroup }
What it pulls in
npm packages
Other registry items
Files it writes
More from @nswds/ui
All 46 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Aspect Ratioaspect-ratio | @nswds/ui | Components | Free | 2 deps · 2 files | |
| Badgebadge | @nswds/ui | Components | Free | 4 deps · 2 files | |
| Buttonbutton | @nswds/ui | Components | Free | 4 deps · 2 files | |
| Cardcard | @nswds/ui | Components | Free | 2 deps · 2 files | |
| Collapsiblecollapsible | @nswds/ui | Components | Free | 1 dep | |
| Drawerdrawer | @nswds/ui | Components | Free | 3 deps · 2 files | |
| Expandable Searchexpandable-search | @nswds/ui | Components | Free | 3 deps · 2 files | |
| Fieldfield | @nswds/ui | Components | Free | 4 deps · 2 files |
