functions

Centered
Edited: Sunday 25 January 2026

Centered

Category: Layouts
File: layouts.go
Package: ui

Signature

1func Centered(w W) W

Description

Centered centers a widget both vertically and horizontally in available space.
Uses flex layouts with SpaceAround to distribute space evenly.

Example:

centered := Centered(Label("I'm in the center!"))

Perfect for splash screens, modals, or centering single elements.

Examples

Centered

1{
2	centered := Centered(Label("I'm centered!"))
3	_ = centered
4}

Example Output


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

Backlinks