LayoutInteractive playground
Resizable
Panels that users can resize.
Preparing the playground…
Text and Markdown example
Resizable · Example
1<ResizablePanelGroup direction="horizontal" style={{height:200,width:380,border:"1px solid var(--color-border)",borderRadius:8}}><ResizablePanel defaultSize={40} minSize={20}><div style={{padding:20}}>Navigation</div></ResizablePanel><ResizableHandle withHandle /><ResizablePanel minSize={20}><div style={{padding:20}}>Your workspace</div></ResizablePanel></ResizablePanelGroup>How to use it
Set direction on the group and minSize/maxSize on panels. ResizableHandle supports keyboard interaction.
Import
React / Next.js
1import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from "@kivora/nextjs";Interactive examples run inside a component with "use client". The playground's Copy button includes the imports needed for the current example.
API reference 0.2.0
Types from the installed published version, including component properties and common HTML attributes. “Optional” does not imply a default value; omitting a property lets the component decide.
| Property | Type | Description |
|---|---|---|
directionRequired | "horizontal" | "vertical" | Axis along which panels are arranged. |
aria-label | string | Accessible name of the control. |
autoSaveId | string | null | Configures autoSaveId. The type describes the supported values and structure. |
children | ReactNode | Content or child elements of the component. |
className | string | Additional CSS classes to customize the element. |
defaultChecked | boolean | Initial selection of the control. |
defaultValue | string | number | readonly string[] | Initial value when the component manages its own state. |
dir | "auto" | "ltr" | "rtl" | Interface reading direction. |
id | string | null | Element identifier; associates labels and descriptions. |
keyboardResizeBy | number | null | Configures keyboardResizeBy. The type describes the supported values and structure. |
onChange | ChangeEventHandler<keyof HTMLElementTagNameMap, Element> | Change event. Check the type: some controls return an object, others a DOM event. |
onClick | MouseEventHandler<keyof HTMLElementTagNameMap> | Action performed when the element is activated. |
onLayout | PanelGroupOnLayout | null | Callback for this event. The signature describes its arguments. |
onSubmit | SubmitEventHandler<keyof HTMLElementTagNameMap> | Form submission event. |
role | AriaRole | Semantic role of the element. Keep the default role unless a change is justified. |
storage | PanelGroupStorage | Configures storage. The type describes the supported values and structure. |
style | CSSProperties | React inline styles. |
tabIndex | number | Keyboard focus order and availability. |
tagName | "object" | "a" | "button" | "div" | "form" | "h2" | "h3" | "img" | "input" | "label" | "li" | "nav" | "ol" | "p" | "select" | "span" | "ul" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "h1" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "ins" | "kbd" | "legend" | "link" | "main" | "map" | "mark" | "menu" | "meta" | "meter" | "noscript" | "optgroup" | "option" | "output" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "search" | "slot" | "script" | "section" | "small" | "source" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "var" | "video" | "wbr" | Configures tagName. The type describes the supported values and structure. |
title | string | Title or supplementary information. |
Subcomponents and composition
Review each component's properties and published declaration. Native and accessibility attributes are inherited from the element specified by its type.
ResizablePanelGroup20 properties
ResizablePanelGroup · TypeScript
1ResizablePanelGroup: ({ className, ...props }: ResizablePanelGroupProps) => React.JSX.ElementResizablePanel23 properties
| Property | Type | Description |
|---|---|---|
aria-label | string | Accessible name of the control. |
children | ReactNode | Content or child elements of the component. |
className | string | Additional CSS classes to customize the element. |
collapsedSize | number | Configures collapsedSize. The type describes the supported values and structure. |
collapsible | boolean | Allow closing content or collapsing the panel. |
defaultChecked | boolean | Initial selection of the control. |
defaultSize | number | Initial panel size. |
defaultValue | string | number | readonly string[] | Initial value when the component manages its own state. |
id | string | Element identifier; associates labels and descriptions. |
maxSize | number | Maximum panel size. |
minSize | number | Minimum panel size. |
onChange | ChangeEventHandler<HTMLDivElement | HTMLElement | HTMLButtonElement | HTMLParagraphElement | HTMLHeadingElement | HTMLSpanElement | HTMLImageElement | HTMLLIElement | HTMLAnchorElement | HTMLOListElement | HTMLInputElement | HTMLTableElement | HTMLLabelElement | HTMLLegendElement | HTMLFieldSetElement | HTMLUListElement | HTMLObjectElement | HTMLLinkElement | HTMLBaseElement | HTMLMapElement | HTMLProgressElement | HTMLSelectElement | HTMLFormElement | HTMLAreaElement | HTMLAudioElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPreElement | HTMLSlotElement | HTMLScriptElement | HTMLSourceElement | HTMLStyleElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement, Element> | Change event. Check the type: some controls return an object, others a DOM event. |
onClick | MouseEventHandler<HTMLDivElement | HTMLElement | HTMLButtonElement | HTMLParagraphElement | HTMLHeadingElement | HTMLSpanElement | HTMLImageElement | HTMLLIElement | HTMLAnchorElement | HTMLOListElement | HTMLInputElement | HTMLTableElement | HTMLLabelElement | HTMLLegendElement | HTMLFieldSetElement | HTMLUListElement | HTMLObjectElement | HTMLLinkElement | HTMLBaseElement | HTMLMapElement | HTMLProgressElement | HTMLSelectElement | HTMLFormElement | HTMLAreaElement | HTMLAudioElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPreElement | HTMLSlotElement | HTMLScriptElement | HTMLSourceElement | HTMLStyleElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement> | Action performed when the element is activated. |
onCollapse | PanelOnCollapse | Callback for this event. The signature describes its arguments. |
onExpand | PanelOnExpand | Callback for this event. The signature describes its arguments. |
onResize | PanelOnResize | Callback for this event. The signature describes its arguments. |
onSubmit | SubmitEventHandler<HTMLDivElement | HTMLElement | HTMLButtonElement | HTMLParagraphElement | HTMLHeadingElement | HTMLSpanElement | HTMLImageElement | HTMLLIElement | HTMLAnchorElement | HTMLOListElement | HTMLInputElement | HTMLTableElement | HTMLLabelElement | HTMLLegendElement | HTMLFieldSetElement | HTMLUListElement | HTMLObjectElement | HTMLLinkElement | HTMLBaseElement | HTMLMapElement | HTMLProgressElement | HTMLSelectElement | HTMLFormElement | HTMLAreaElement | HTMLAudioElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPreElement | HTMLSlotElement | HTMLScriptElement | HTMLSourceElement | HTMLStyleElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement> | Form submission event. |
order | number | Configures order. The type describes the supported values and structure. |
role | AriaRole | Semantic role of the element. Keep the default role unless a change is justified. |
style | (CSSProperties & object) | React inline styles. |
tabIndex | number | Keyboard focus order and availability. |
tagName | "object" | "a" | "button" | "div" | "form" | "h2" | "h3" | "img" | "input" | "label" | "li" | "nav" | "ol" | "p" | "select" | "span" | "ul" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "h1" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "ins" | "kbd" | "legend" | "link" | "main" | "map" | "mark" | "menu" | "meta" | "meter" | "noscript" | "optgroup" | "option" | "output" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "search" | "slot" | "script" | "section" | "small" | "source" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "var" | "video" | "wbr" | Configures tagName. The type describes the supported values and structure. |
title | string | Title or supplementary information. |
ResizablePanel · TypeScript
1ResizablePanel: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement | HTMLDivElement | HTMLObjectElement | HTMLLinkElement | HTMLInputElement | HTMLBaseElement | HTMLMapElement | HTMLProgressElement | HTMLSelectElement | HTMLAnchorElement | HTMLButtonElement | HTMLFormElement | HTMLHeadingElement | HTMLImageElement | HTMLLabelElement | HTMLLIElement | HTMLOListElement | HTMLParagraphElement | HTMLSpanElement | HTMLUListElement | HTMLAreaElement | HTMLAudioElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLLegendElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPreElement | HTMLSlotElement | HTMLScriptElement | HTMLSourceElement | HTMLStyleElement | HTMLTableElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement>, "id" | "onResize"> & {
2 className?: string;
3 collapsedSize?: number | undefined;
4 collapsible?: boolean | undefined;
5 defaultSize?: number | undefined;
6 id?: string;
7 maxSize?: number | undefined;
8 minSize?: number | undefined;
9 onCollapse?: ResizablePrimitive.PanelOnCollapse;
10 onExpand?: ResizablePrimitive.PanelOnExpand;
11 onResize?: ResizablePrimitive.PanelOnResize;
12 order?: number;
13 style?: object;
14 tagName?: keyof HTMLElementTagNameMap | undefined;
15} & {
16 children?: React.ReactNode | undefined;
17} & React.RefAttributes<ResizablePrimitive.ImperativePanelHandle>>ResizableHandle22 properties
| Property | Type | Description |
|---|---|---|
aria-label | string | Accessible name of the control. |
children | ReactNode | Content or child elements of the component. |
className | string | Additional CSS classes to customize the element. |
defaultChecked | boolean | Initial selection of the control. |
defaultValue | string | number | readonly string[] | Initial value when the component manages its own state. |
disabled | boolean | Disable interaction with the control. |
hitAreaMargins | PointerHitAreaMargins | Configures hitAreaMargins. The type describes the supported values and structure. |
id | string | null | Element identifier; associates labels and descriptions. |
onBlur | (() => void) | Callback for this event. The signature describes its arguments. |
onChange | ChangeEventHandler<keyof HTMLElementTagNameMap, Element> | Change event. Check the type: some controls return an object, others a DOM event. |
onClick | (() => void) | Action performed when the element is activated. |
onDragging | PanelResizeHandleOnDragging | Callback for this event. The signature describes its arguments. |
onFocus | (() => void) | Callback for this event. The signature describes its arguments. |
onPointerDown | (() => void) | Callback for this event. The signature describes its arguments. |
onPointerUp | (() => void) | Callback for this event. The signature describes its arguments. |
onSubmit | SubmitEventHandler<keyof HTMLElementTagNameMap> | Form submission event. |
role | AriaRole | Semantic role of the element. Keep the default role unless a change is justified. |
style | CSSProperties | React inline styles. |
tabIndex | number | Keyboard focus order and availability. |
tagName | "object" | "a" | "button" | "div" | "form" | "h2" | "h3" | "img" | "input" | "label" | "li" | "nav" | "ol" | "p" | "select" | "span" | "ul" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "h1" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "ins" | "kbd" | "legend" | "link" | "main" | "map" | "mark" | "menu" | "meta" | "meter" | "noscript" | "optgroup" | "option" | "output" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "search" | "slot" | "script" | "section" | "small" | "source" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "var" | "video" | "wbr" | Configures tagName. The type describes the supported values and structure. |
title | string | Title or supplementary information. |
withHandle | boolean | Show a visual grip on the separator. |
ResizableHandle · TypeScript
1declare function ResizableHandle({ className, withHandle, ...props }: ResizableHandleProps): React.JSX.Element;API generated from @kivora/nextjs 0.2.0View package