- Prop
direction- Type
"horizontal" | "vertical" | undefined- Default
"horizontal"- Requirement
- optional
- Description
- Split direction.
Docs Components Primitives
Resizable
React example follows below.
Vue example follows below.
Angular example follows below.
Svelte example follows below.
Solid example follows below.
- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
const resizableFixture = { id: "resizable", defaultSize: 50, className: "h-[200px] w-full", first: { label: "Editor", body: "Drag the handle to split." }, second: { label: "Preview", className: "bg-sunken", body: "Arrow keys nudge the handle when focused.", },} satisfies { id: string; defaultSize: number; className: string; first: { label: string; body: string }; second: { label: string; className: string; body: string };}; import { Resizable, ResizablePanel } from "@grassroot/ui-react"; export default function ResizableDemo() { return ( <div> <Resizable defaultSize={resizableFixture.defaultSize} className={resizableFixture.className}> <ResizablePanel label={resizableFixture.first.label}> {resizableFixture.first.body} </ResizablePanel> <ResizablePanel label={resizableFixture.second.label} className={resizableFixture.second.className} > {resizableFixture.second.body} </ResizablePanel> </Resizable> </div> );}- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
<script setup lang="ts">const resizableFixture = { id: "resizable", defaultSize: 50, className: "h-[200px] w-full", first: { label: "Editor", body: "Drag the handle to split." }, second: { label: "Preview", className: "bg-sunken", body: "Arrow keys nudge the handle when focused.", },} satisfies { id: string; defaultSize: number; className: string; first: { label: string; body: string }; second: { label: string; className: string; body: string };}; import { Resizable, ResizablePanel } from "@grassroot/ui-vue";</script> <template> <div> <Resizable :default-size="resizableFixture.defaultSize" :class="resizableFixture.className"> <template #first> <ResizablePanel :label="resizableFixture.first.label">{{ resizableFixture.first.body }}</ResizablePanel> </template> <template #second> <ResizablePanel :label="resizableFixture.second.label" :class="resizableFixture.second.className" > {{ resizableFixture.second.body }} </ResizablePanel> </template> </Resizable> </div></template>- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
import { Component } from "@angular/core";const resizableFixture = { id: "resizable", defaultSize: 50, className: "h-[200px] w-full", first: { label: "Editor", body: "Drag the handle to split." }, second: { label: "Preview", className: "bg-sunken", body: "Arrow keys nudge the handle when focused.", },} satisfies { id: string; defaultSize: number; className: string; first: { label: string; body: string }; second: { label: string; className: string; body: string };}; import { GrassrootResizable, GrassrootResizablePanel } from "@grassroot/ui-angular"; @Component({ selector: "app-resizable-demo", standalone: true, imports: [GrassrootResizable, GrassrootResizablePanel], template: ` <div> <grassroot-resizable [defaultSize]="fixture.defaultSize" [class]="fixture.className"> <grassroot-resizable-panel first [label]="fixture.first.label">{{ fixture.first.body }}</grassroot-resizable-panel> <grassroot-resizable-panel second [label]="fixture.second.label" [class]="fixture.second.className" > {{ fixture.second.body }} </grassroot-resizable-panel> </grassroot-resizable> </div> `,})export class ResizableDemoComponent { protected readonly fixture = resizableFixture;} export default ResizableDemoComponent;- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
<script lang="ts"> import { Resizable, ResizablePanel } from "@grassroot/ui-svelte"; const resizableFixture = { id: "resizable", defaultSize: 50, className: "h-[200px] w-full", first: { label: "Editor", body: "Drag the handle to split." }, second: { label: "Preview", className: "bg-sunken", body: "Arrow keys nudge the handle when focused.", }, } satisfies { id: string; defaultSize: number; className: string; first: { label: string; body: string }; second: { label: string; className: string; body: string }; }; </script> <div> <Resizable defaultSize={resizableFixture.defaultSize} className={resizableFixture.className}> {#snippet first()} <ResizablePanel label={resizableFixture.first.label} >{resizableFixture.first.body}</ResizablePanel > {/snippet} {#snippet second()} <ResizablePanel label={resizableFixture.second.label} className={resizableFixture.second.className} > {resizableFixture.second.body} </ResizablePanel> {/snippet} </Resizable></div>- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
/** @jsxImportSource solid-js */const resizableFixture = { id: "resizable", defaultSize: 50, className: "h-[200px] w-full", first: { label: "Editor", body: "Drag the handle to split." }, second: { label: "Preview", className: "bg-sunken", body: "Arrow keys nudge the handle when focused.", },} satisfies { id: string; defaultSize: number; className: string; first: { label: string; body: string }; second: { label: string; className: string; body: string };}; import { Resizable, ResizablePanel } from "@grassroot/ui-solid"; export default function ResizableDemo() { return ( <div> <Resizable defaultSize={resizableFixture.defaultSize} className={resizableFixture.className}> <ResizablePanel label={resizableFixture.first.label}> {resizableFixture.first.body} </ResizablePanel> <ResizablePanel label={resizableFixture.second.label} className={resizableFixture.second.className} > {resizableFixture.second.body} </ResizablePanel> </Resizable> </div> );}Installation
API Reference
Import
import { Resizable, ResizablePanel } from "@grassroot/ui-react";
Props
Prop
Type
Default
Requirement
Description
direction"horizontal" | "vertical" | undefined"horizontal"optional
Split direction.
defaultSizenumber | undefined50optional
Initial size of the first pane, in %.
minSizenumber | undefined12optional
Minimum size of either pane, in %.
stepnumber | undefined4optional
Keyboard nudge step, in %.
onResize((size: number) => void) | undefined—
optional
Notified after each resize, with the first pane's new %.
- Prop
defaultSize- Type
number | undefined- Default
50- Requirement
- optional
- Description
- Initial size of the first pane, in %.
- Prop
minSize- Type
number | undefined- Default
12- Requirement
- optional
- Description
- Minimum size of either pane, in %.
- Prop
step- Type
number | undefined- Default
4- Requirement
- optional
- Description
- Keyboard nudge step, in %.
- Prop
onResize- Type
((size: number) => void) | undefined- Default
- —
- Requirement
- optional
- Description
- Notified after each resize, with the first pane's new %.
Events
| Event | Payload |
|---|---|
onResize | ((size: number) => void) | undefined |
Content regions
children
Native attributes
Standard DOM and ARIA attributes not listed above spread onto the root element.
Import
import { Resizable, ResizablePanel } from "@grassroot/ui-vue";
Props
Prop
Type
Default
Requirement
direction"horizontal" | "vertical" | undefined"horizontal"optional
defaultSizenumber | undefined50optional
minSizenumber | undefined12optional
stepnumber | undefined4optional
- Prop
direction- Type
"horizontal" | "vertical" | undefined- Default
"horizontal"- Requirement
- optional
- Prop
defaultSize- Type
number | undefined- Default
50- Requirement
- optional
- Prop
minSize- Type
number | undefined- Default
12- Requirement
- optional
- Prop
step- Type
number | undefined- Default
4- Requirement
- optional
Events
| Event | Payload |
|---|---|
resize | [size: number] |
Content regions
firstsecond
Import
import { Component } from "@angular/core";
import { GrassrootResizable, GrassrootResizablePanel } from "@grassroot/ui-angular";
Props
Prop
Type
Default
Requirement
direction"horizontal" | "vertical""horizontal"optional
defaultSizenumber50optional
minSizenumber12optional
stepnumber4optional
- Prop
direction- Type
"horizontal" | "vertical"- Default
"horizontal"- Requirement
- optional
- Prop
defaultSize- Type
number- Default
50- Requirement
- optional
- Prop
minSize- Type
number- Default
12- Requirement
- optional
- Prop
step- Type
number- Default
4- Requirement
- optional
Events
| Event | Payload |
|---|---|
resize | number |
Content regions
firstsecond
Import
import { Resizable, ResizablePanel } from "@grassroot/ui-svelte";
Props
Prop
Type
Default
Requirement
direction"horizontal" | "vertical""horizontal"optional
defaultSizenumber50optional
minSizenumber12optional
stepnumber4optional
onResize(size: number) => void—
optional
classNamestring—
optional
- Prop
direction- Type
"horizontal" | "vertical"- Default
"horizontal"- Requirement
- optional
- Prop
defaultSize- Type
number- Default
50- Requirement
- optional
- Prop
minSize- Type
number- Default
12- Requirement
- optional
- Prop
step- Type
number- Default
4- Requirement
- optional
- Prop
onResize- Type
(size: number) => void- Default
- —
- Requirement
- optional
- Prop
className- Type
string- Default
- —
- Requirement
- optional
Events
| Event | Payload |
|---|---|
onResize | (size: number) => void |
Content regions
childrenfirstsecond
Import
import { Resizable, ResizablePanel } from "@grassroot/ui-solid";
Props
Prop
Type
Default
Requirement
direction"horizontal" | "vertical"—
optional
defaultSizenumber—
optional
minSizenumber—
optional
stepnumber—
optional
onResize(size: number) => void—
optional
classNamestring—
optional
- Prop
direction- Type
"horizontal" | "vertical"- Default
- —
- Requirement
- optional
- Prop
defaultSize- Type
number- Default
- —
- Requirement
- optional
- Prop
minSize- Type
number- Default
- —
- Requirement
- optional
- Prop
step- Type
number- Default
- —
- Requirement
- optional
- Prop
onResize- Type
(size: number) => void- Default
- —
- Requirement
- optional
- Prop
className- Type
string- Default
- —
- Requirement
- optional
Events
| Event | Payload |
|---|---|
onResize | (size: number) => void |
Content regions
children
Native attributes
Standard DOM and ARIA attributes not listed above spread onto the root element.