Resizable

Des panneaux côte à côte ou empilés, séparés par des poignées : à faire glisser ou à piloter au clavier comme le séparateur de fenêtres de WAI-ARIA, avec tailles minimale et maximale, panneaux repliables, tailles bidirectionnelles et sauvegarde facultative.

Disponible pour
  • Angular: disponible
  • Vue: disponible
  • React: disponible
  • React Native: pas encore disponible

Utilisation

Sidebar
Content
Console

Sidebar: 30%

Importation

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

Référence de l’API

SoneResizableGroupComponentComposant

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

Sélecteur
sone-resizable-group
Exporté sous
soneResizableGroup
Inputs
NomType Par défaut
directionResizableDirection"horizontal"
sizesbidirectionnel

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

SoneResizableHandleComponentComposant

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

Sélecteur
sone-resizable-handle
Inputs
NomType Par défaut
withHandle

Draw a grip on the handle.

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

SoneResizablePanelComponentComposant

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

Sélecteur
sone-resizable-panel
Inputs
NomType Par défaut
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