DOCS
v0.4

Components / Resizable

Resizable

Split-pane resizable container with drag handle, horizontal/vertical direction, and size bounds.

layoutv0.8.0

Playground

Examples

Horizontal split
Left
Right
<cg-resizable style="height:240px;"><div slot="panel-1" style="background:#1a1a1a;padding:16px;">Left</div><div slot="panel-2" style="background:#242424;padding:16px;">Right</div></cg-resizable>

Import

import { CgResizable } from '@cognivo/components';
// Or tree-shake: import '@cognivo/components/cg-resizable';

Per-component imports ship only that component (~8 kB gzip).

API Reference

PropTypeDefaultDescription
direction"horizontal"|"vertical""horizontal"Split direction
defaultSizenumber0.5Initial pane 1 fraction
minnumber0.1Minimum pane 1 fraction
maxnumber0.9Maximum pane 1 fraction

Events

EventDetailDescription
cg-resizable-change{size}Pane size changed