functions
Constraint| modified | Sunday 25 January 2026 |
|---|
Category: Utilities
File: layouts.go
Package: ui
1func Constraint(width, height int, w W) W
Constraint limits a widget’s maximum dimensions to the specified width and height.
Forces the widget to render within these bounds.
Example:
limited := Constraint(200, 100, Label("Limited size"))
Useful for creating fixed-size containers or limiting widget expansion.
1{
2 limited := Constraint(200, 100, Label("Limited size"))
3 _ = limited
4}

This documentation is auto-generated. To update, run make docs