Resizable

左右または上下に並べ、間にハンドルを置いたパネル。ドラッグでも WAI-ARIA のウィンドウスプリッターのキーボード操作でも動かせ、最小・最大サイズ、折りたたみ可能なパネル、双方向バインドのサイズ、任意の保存に対応します。

対応フレームワーク
  • Angular: 対応
  • Vue: 対応
  • React: 対応
  • React Native: 未対応

使い方

Sidebar
Content
Console

Sidebar: 30%

インポート

ts
import {
  SoneResizableGroupComponent,
  SoneResizableHandleComponent,
  SoneResizablePanelComponent,
} from "@surface-one/angular/resizable";

API リファレンス

SoneResizableGroupComponentコンポーネント

`sone-resizable-group` — resizable panels (shadcn/ui Resizable, spartan/ui Resizable): `sone-resizable-panel`s side by side (`direction="horizontal"`) or stacked (`vertical`), with a `sone-resizable-handle` between each pair. Sizes are percentages of the group, two-way as `[(sizes)]` (one per panel); each panel's `defaultSize`, `minSize`, `maxSize` and `collapsible` set the rest. A handle is a WAI-ARIA window splitter: drag it, or focus it and use the arrow keys, Home / End and Enter (collapse or restore a collapsible panel). Give `autoSaveId` and a `storage` (`localStorage`, or your own `getItem` / `setItem`) to keep the sizes between visits; the library never touches storage by itself.

セレクター
sone-resizable-group
エクスポート名
soneResizableGroup
入力
名前型 デフォルト
directionResizableDirection"horizontal"
sizes双方向

The panels' sizes in percent, two-way: `[(sizes)]`. Empty: their defaults.

readonly number[][]
autoSaveId

Keep the sizes in `storage` under this id.

string | nullnull
storage

Where `autoSaveId` keeps them — pass `localStorage`, or your own.

ResizableStorage | nullnull

SoneResizableHandleComponentコンポーネント

`sone-resizable-handle` — the window splitter between two panels (`role="separator"`, its value the size of the panel before it). `withHandle` draws a grip.

セレクター
sone-resizable-handle
入力
名前型 デフォルト
withHandle

Draw a grip on the handle.

booleanfalse
disabledbooleanfalse
label—$localize`:Names the splitter between two resizable panels:Resize panels`

SoneResizablePanelComponentコンポーネント

`sone-resizable-panel` — one panel; its size is a percentage of the group.

セレクター
sone-resizable-panel
入力
名前型 デフォルト
defaultSize

Its size before any is bound or stored (percent); left out, it shares the rest.

nullnull
minSizenumber0
maxSizenumber100
collapsible

It collapses to `collapsedSize` when dragged well past `minSize`, or on Enter.

booleanfalse
collapsedSizenumber0
idstring | nullnull