Resizable
solid-ui/resizableFreeComponent
A resizable component
Live preview
live · rendered by the registry
Rendered by solid-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.solid-ui.com/r/resizable.jsonSource
1import type { ValidComponent } from "solid-js"2import { Show, splitProps } from "solid-js"34import type { DynamicProps, HandleProps, RootProps } from "@corvu/resizable"5import ResizablePrimitive from "@corvu/resizable"67import { cn } from "~/lib/utils"89type ResizableProps<T extends ValidComponent = "div"> = RootProps<T> & { class?: string }1011const Resizable = <T extends ValidComponent = "div">(props: DynamicProps<T, ResizableProps<T>>) => {12 const [, rest] = splitProps(props as ResizableProps, ["class"])13 return (14 <ResizablePrimitive15 class={cn("flex size-full data-[orientation=vertical]:flex-col", props.class)}16 {...rest}17 />18 )19}2021const ResizablePanel = ResizablePrimitive.Panel2223type ResizableHandleProps<T extends ValidComponent = "button"> = HandleProps<T> & {24 class?: string25 withHandle?: boolean26}2728const ResizableHandle = <T extends ValidComponent = "button">(29 props: DynamicProps<T, ResizableHandleProps<T>>30) => {31 const [, rest] = splitProps(props as ResizableHandleProps, ["class", "withHandle"])32 return (33 <ResizablePrimitive.Handle34 class={cn(35 "relative flex w-px shrink-0 items-center justify-center bg-border 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-[orientation=vertical]:h-px data-[orientation=vertical]:w-full data-[orientation=vertical]:after:left-0 data-[orientation=vertical]:after:h-1 data-[orientation=vertical]:after:w-full data-[orientation=vertical]:after:-translate-y-1/2 data-[orientation=vertical]:after:translate-x-0 [&[data-orientation=vertical]>div]:rotate-90",36 props.class37 )}38 {...rest}39 >40 <Show when={props.withHandle}>41 <div class="z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border">42 <svg43 xmlns="http://www.w3.org/2000/svg"44 viewBox="0 0 24 24"45 fill="none"46 stroke="currentColor"47 stroke-width="2"48 stroke-linecap="round"49 stroke-linejoin="round"50 class="size-2.5"51 >52 <path d="M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" />53 <path d="M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" />54 <path d="M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" />55 <path d="M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" />56 <path d="M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" />57// … truncated
What it pulls in
npm packages
Files it writes
More from solid-ui
All 55 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | solid-ui | Components | Free | 2 deps | |
| Alertalert | solid-ui | Components | Free | 3 deps | |
| Alert Dialogalert-dialog | solid-ui | Components | Free | 2 deps | |
| Aspect Ratioaspect-ratio | solid-ui | Components | Free | 1 dep | |
| Avataravatar | solid-ui | Components | Free | 2 deps | |
| Badgebadge | solid-ui | Components | Free | 2 deps | |
| Badge Deltabadge-delta | solid-ui | Components | Free | 2 deps | |
| Bar Listbar-list | solid-ui | Components | Free | 1 dep |
