FloatWidget
Namespace: Hex1b.Widgets
Assembly: Hex1b.dll
Wraps a child widget and removes it from the container's normal layout flow. The float is positioned either at absolute coordinates or relative to an anchor widget.
public sealed record FloatWidget : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<FloatWidget>Inheritance
Object → Hex1bWidget → FloatWidget
Implements
Constructors
FloatWidget(Hex1bWidget)
Wraps a child widget and removes it from the container's normal layout flow. The float is positioned either at absolute coordinates or relative to an anchor widget.
Parameters:
Child(Hex1bWidget): The child widget to float out of the layout flow.
public FloatWidget(Hex1bWidget Child)Properties
Child
The child widget to float out of the layout flow.
Returns: Hex1bWidget
public Hex1bWidget Child { get; init; }Methods
Absolute(int, int)
Positions the float at absolute (x, y) character coordinates within the container.
Parameters:
Returns: FloatWidget
public FloatWidget Absolute(int x, int y)AlignBottom(Hex1bWidget, int)
Float's bottom edge aligns with anchor's bottom edge.
Parameters:
anchor(Hex1bWidget):offset(Int32):
Returns: FloatWidget
public FloatWidget AlignBottom(Hex1bWidget anchor, int offset = 0)AlignLeft(Hex1bWidget, int)
Float's left edge aligns with anchor's left edge.
Parameters:
anchor(Hex1bWidget):offset(Int32):
Returns: FloatWidget
public FloatWidget AlignLeft(Hex1bWidget anchor, int offset = 0)AlignRight(Hex1bWidget, int)
Float's right edge aligns with anchor's right edge.
Parameters:
anchor(Hex1bWidget):offset(Int32):
Returns: FloatWidget
public FloatWidget AlignRight(Hex1bWidget anchor, int offset = 0)AlignTop(Hex1bWidget, int)
Float's top edge aligns with anchor's top edge.
Parameters:
anchor(Hex1bWidget):offset(Int32):
Returns: FloatWidget
public FloatWidget AlignTop(Hex1bWidget anchor, int offset = 0)ExtendBottom(Hex1bWidget, int)
Float's top edge aligns with anchor's bottom edge (place below).
Parameters:
anchor(Hex1bWidget):offset(Int32):
Returns: FloatWidget
public FloatWidget ExtendBottom(Hex1bWidget anchor, int offset = 0)ExtendLeft(Hex1bWidget, int)
Float's right edge aligns with anchor's left edge (place beside, to the left).
Parameters:
anchor(Hex1bWidget):offset(Int32):
Returns: FloatWidget
public FloatWidget ExtendLeft(Hex1bWidget anchor, int offset = 0)ExtendRight(Hex1bWidget, int)
Float's left edge aligns with anchor's right edge (place beside, to the right).
Parameters:
anchor(Hex1bWidget):offset(Int32):
Returns: FloatWidget
public FloatWidget ExtendRight(Hex1bWidget anchor, int offset = 0)ExtendTop(Hex1bWidget, int)
Float's bottom edge aligns with anchor's top edge (place above).
Parameters:
anchor(Hex1bWidget):offset(Int32):
Returns: FloatWidget
public FloatWidget ExtendTop(Hex1bWidget anchor, int offset = 0)Remarks
FloatWidget is not reconciled directly — the parent container (VStack, HStack, etc.) detects float children and handles their reconciliation, measurement, and arrangement separately from flow children. Floats render after all flow children to maintain correct z-ordering.
Examples
// Absolute positioning
ctx.VStack(v => [
v.Text("Normal flow"),
v.Float(v.Icon("📍")).Absolute(10, 5),
])
// Anchor-relative positioning
var header = v.Text("Header");
ctx.VStack(v => [
header,
v.Float(v.Text("Tooltip")).AlignRight(header).ExtendBottom(header),
])