[GH-ISSUE #16] Add an equivalent of insertBefore to renderable #6

Closed
opened 2026-03-02 23:43:47 +03:00 by kerem · 0 comments
Owner

Originally created by @fezproof on GitHub (Aug 15, 2025).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/16

Right now you can only add children to a parent Renderable by using add. It would be nice to be able to add children either via an anchor node as described in insertBefore, or be able to insert a child at a particular index.

Something like

parent.insertBefore(child, anchor);

// OR

parent.add(child, 5);

This will allow working with external layout systems much nicer. For example, SolidJS need functionality like this for it's universal renderer (which is how I ran into this).

Originally created by @fezproof on GitHub (Aug 15, 2025). Original GitHub issue: https://github.com/anomalyco/opentui/issues/16 Right now you can only add children to a parent Renderable by using add. It would be nice to be able to add children either via an anchor node as described in [insertBefore](https://developer.mozilla.org/en-US/docs/Web/API/Node/insertBefore), or be able to insert a child at a particular index. Something like ```typescript parent.insertBefore(child, anchor); // OR parent.add(child, 5); ``` This will allow working with external layout systems much nicer. For example, SolidJS need functionality like this for it's universal renderer (which is how I ran into this).
kerem closed this issue 2026-03-02 23:43:47 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#6
No description provided.