v1.0
Primitive API / Page 04·05

FlexiResize

A resize handle for a widget. Widgets have no resize affordance of their own, so this is how users resize them with a pointer or the keyboard.

FlexiResize (component)

Props
NameDescription
children
Optional
Snippet<[{ widget: FlexiWidgetController }]>

The content of the handle. Receives the surrounding widget's controller.

class
Optional
ClassValue

Classes applied to the rendered button.

FlexiResize renders a button inside a FlexiWidget. Dragging it resizes the widget along the axes allowed by its resizability; the button is disabled while resizability is 'none'. Position it yourself, typically in the widget’s bottom-right corner.

Svelte Resize handle
Press Enter to grab or resize widgets. Once grabbed, use Arrow keys to move/resize the widget, Enter to confirm the action, or Esc to cancel it.
1 × 1

FlexiResize has no controller of its own. Its content receives the surrounding widget’s controller, so the handle can react to widget.isResizing. Limits come from the widget’s minWidth, maxWidth, minHeight, and maxHeight props; see FlexiWidget.

Accessibility

  • The handle is a native button: focusable with Tab, disabled when the widget cannot be resized. Give it a visually hidden text label.
  • Enter on the handle starts a keyboard resize, the arrow keys move the resize edge, Enter confirms, and Escape cancels. See [Accessibility](/docs/accessibility).

Gotchas

  • A FlexiResize must be rendered inside a FlexiWidget. Outside one, it throws.
  • Give the widget’s element position: relative (or similar) so an absolutely positioned handle stays inside it.
  • In a flow grid the flow-axis dimension is fixed at 1, so only the cross-axis resizes. See Flow Grids.