Skip to content

[✨] onResize$ #261

@gederer

Description

@gederer

Is your feature request related to a problem?

Often, components can be made responsive using pure CSS with media queries and container queries; however, some components have to manage their own display when dynamically resized. Currently, this is handled by creating a ResizeObserver by hand. It would be convenient if the framework provided a simple API for setting up resize behavior, and created the ResizeObserver under the hood.

Describe the solution you'd like

This feature could be implemented as an onResize$ attribute that could be added to any Qwik component.

Example:

<MyComponent onResize$={(entry: ResizeObserverEntry) => {
  // My display management logic
}} />

Describe alternatives you've considered

Setting up a ResizeObserver by hand.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions