Loading...
Installation
Install the following dependencies:
Copy and paste the following code into your project.
Loading...
Update the import paths to match your project setup.
Composition
<app-resizable> ├── [appResizablePanel] ├── <app-resizable-handle> │ └── generated handle icon (optional) └── [appResizablePanel]
Examples
Collapsible
Loading...
Controlled
Loading...
Default
Loading...
Disabled
Loading...
Size Constraints
Loading...
Vertical
Loading...
With Handle
Loading...
API Reference
<app-resizable>
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
id | string | undefined | generated | Unique identifier used to create the splitter part IDs. |
ids | SplitterElementIds | undefined | — | Overrides the generated IDs for individual parts. |
orientation | "horizontal" | "vertical" | undefined | "horizontal" | Sets the layout and keyboard navigation axis. |
size | Array<number | string> | undefined | — | Panel sizes when controlled. Supports Angular two-way binding. |
defaultSize | Array<number | string> | undefined | [] | Initial panel sizes when uncontrolled. |
panels | SplitterPanelData[] | required | Describes the panels, their order, constraints, and collapse state. |
keyboardResizeBy | number | null | undefined | — | Amount to resize by when an arrow key is pressed. |
nonce | string | undefined | — | CSP nonce applied to the splitter's generated styles. |
registry | SplitterRegistry | undefined | — | Registry used to coordinate resize handles. |
Use [(size)]="size" for two-way binding, or combine [size] with (sizeChange) when using
signals. The resize output provides the full resize details while the panels are changing.
Outputs
| Output | Type | Description |
|---|---|---|
sizeChange | Array<number | string> | undefined | Emits the current controlled panel sizes. |
resize | SplitterResizeDetails | Emits details while panel sizes change. |
resizeStart | void | Emits when a pointer or keyboard resize starts. |
resizeEnd | SplitterResizeEndDetails | Emits details when resizing ends. |
collapse | SplitterExpandCollapseDetails | Emits when a collapsible panel collapses. |
expand | SplitterExpandCollapseDetails | Emits when a collapsed panel expands. |
[appResizablePanel]
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
id | SplitterPanelId | required | ID matching an entry in the panel data. |
<app-resizable-handle>
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
id | SplitterResizeTriggerId | required | IDs of the adjacent panels in the form "before:after". |
disabled | boolean | false | Disables pointer and keyboard resizing through this handle. |
withHandle | boolean | false | Displays the visual grip inside the resize handle. |
Context, Providers, and Utilities
| Export | Angular API |
|---|---|
SplitterRootProvider | Directive that provides an externally created splitter API through value. |
SplitterContext | Structural directive [splitter-context] exposing the root API to a template. |
useSplitter(options) | Creates the signal-backed splitter machine inside an injection context. |
injectSplitterContext() | Injects the nearest splitter root context. |
injectSplitterResizeTriggerContext() | Injects the nearest resize-trigger context. |
createSplitterRegistry(props) | Creates a registry used to coordinate resize handles. |
getSplitterLayout(panels) | Returns the CSS grid layout for a panel configuration. |
ResizableImports | Readonly collection containing the resizable UI and context helpers. |
Types
| Export | Description |
|---|---|
SplitterApi | Connected splitter state and actions. |
SplitterElementIds | Overrides for generated splitter part IDs. |
SplitterPanelData | Panel ID, ordering, size constraints, and collapse configuration. |
SplitterPanelId | Identifier for a panel. |
SplitterResizeTriggerId | Identifier joining the panels adjacent to a resize handle. |
SplitterResizeTriggerState | Dragging, focus, and disabled state for a resize handle. |
SplitterResizeDetails | Details emitted by resize. |
SplitterResizeEndDetails | Details emitted by resizeEnd. |
SplitterExpandCollapseDetails | Details emitted by collapse and expand. |
SplitterHitAreaMargins | Coarse and fine pointer hit-area margins. |
SplitterRegistryOptions | Options used to configure a splitter registry. |
SplitterRegistryProps | Angular options accepted by createSplitterRegistry. |
SplitterRegistryReturn | Registry returned by createSplitterRegistry. |
SplitterResizeTriggerContext | Signal-backed state exposed for the nearest resize handle. |
UseSplitterOptions | Options accepted by useSplitter. |
UseSplitterProps | Root props accepted by the splitter machine. |
UseSplitterReturn | Signal-backed splitter machine returned by useSplitter. |
Angular
React
Solid
Svelte
Vue