Resize

Table of Contents

Basic Usage

Set the initial height and width using normal styles.

<k-resize
style="height: 200px; width: 200px;"
>

Resize Me
</k-resize>

Resize Me

Set the minimum and maximum height and width using normal styles. The default min-height and min-width is 10rem and the default max-height and max-width is 100%.

<k-resize
style="min-height: 100px; height: 200px; max-height: 300px; min-width: 100px; width: 200px; max-width: 300px;"
>

Resize Me
</k-resize>

Resize Me

Resize Dimension

<k-resize
style="height: 200px; width: 200px;"
dimension="width"
>

Resize Width
</k-resize>

Resize Width

<k-resize
style="height: 200px; width: 200px;"
dimension="height"
>

Resize Height
</k-resize>

Resize Height

* Notes

Additional styles may be added to the example output (borders, spacing, colors) for demonstration.

JavaScript Reference

Constructor

Extends ShadowComponent
new Resize()

Requirements

Properties

resizing: string

Indicates which handle is currently being used to resize the element. Values can be "side", "bottom", "corner", or empty string. Syncs with the resizing attribute.

dimension: string

Restricts resizing to a specific dimension. Possible values are "width" (horizontal only) or "height" (vertical only). If not specified, both dimensions can be resized. Syncs with the dimension attribute.

Slots

default

The main content area that will be resizable. Content automatically gets scroll behavior when it overflows the container.

Resize Handles

The resize component provides three types of handles:

CSS Custom Properties

The component respects the following CSS custom properties:

Touch and Mouse Support

The component supports both mouse and touch interactions for resizing on desktop and mobile devices.

Behavior Notes