Optionalstyle: FlexboxStyleCSS properties.
Optionalindex: numberindex in which to insert the object into. defaults to appending the object.
turns the object into a flexbox. without binding position and size. useful for implementing custom transition and custom size measuring.
Optionalstyle: FlexboxStyleCSS properties.
Optionalindex: numberindex in which to insert the object into. defaults to appending the object.
const object = k.add([
k.pos(0,0),
k.rect(0,0),
k.flexNode(),
])
obj.onLayoutShift(() => {
const { width, height } = object.getComputedSize()
k.tween(object.pos, object.getComputedOffset(), 1, a => object.pos = a)
k.tween(object.width, width, 1, a => object.width = a)
k.tween(object.height, height, 1, a => object.height = a)
})
turns the object into a static children. its size is not managed by kaplay-layout so it wont grow or shrink.
Optionalstyle: StaticFlexboxStyleCSS properties.
Optionalindex: numberindex in which to insert the object into. defaults to appending the object.
turns the object into a flexbox. the object size (and position if it is a child to another flexbox) will be automatically changed to match the layout.