Resizable

Panele obok siebie lub jeden nad drugim z uchwytami pomiędzy — przeciągane myszą lub obsługiwane klawiaturą jak rozdzielacz okien z WAI-ARIA, z minimalnymi i maksymalnymi rozmiarami, zwijanymi panelami, dwukierunkowymi rozmiarami i opcjonalnym zapisem.

Dostępny w
  • Angular: dostępny
  • Vue: dostępny
  • React: dostępny
  • React Native: jeszcze niedostępny

Użycie

Sidebar
Content
Console

Sidebar: 30%

Import

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

Dokumentacja API

SoneResizableGroupComponentKomponent

`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.

Selektor
sone-resizable-group
Eksport jako
soneResizableGroup
Wejścia
NazwaTyp Domyślnie
directionResizableDirection"horizontal"
sizesdwukierunkowe

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

SoneResizableHandleComponentKomponent

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

Selektor
sone-resizable-handle
Wejścia
NazwaTyp Domyślnie
withHandle

Draw a grip on the handle.

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

SoneResizablePanelComponentKomponent

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

Selektor
sone-resizable-panel
Wejścia
NazwaTyp Domyślnie
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