Call Button.new() directly and padding, height and wrapping drift slightly from screen to
screen. That drift is invisible in code review and obvious in a screenshot.
| Group | Functions |
|---|---|
| Structure | column row wrap_row padding spacer divider responsive_grid aspect foldable |
| Text | label label_key line section typography |
| Buttons | button button_key icon_button list_button list_row apply_icon style_choice_card style_chip_button style_chip_label |
| Input | line_edit textarea toggle checkbox slider picker select dropdown radio_group segmented choice_grid |
| Display | card chip hud_panel chip_panel avatar skeleton alert table tabs breadcrumb progress empty_state |
| Surface pieces | surface box floating disc face_padding |
| Helpers | form fit_words natural_width tooltip_node card_body let_input_through |
box() always returns a StyleBoxFlat, because callers receive it and
adjust bg_color or corner_radius. Use surface() when a custom
shape has to survive.
List rows with a description
GoStyle.list_button(GoIconSet.SWORD, "Oathkeeper", _inspect, Color.TRANSPARENT,
"Longsword / Attack 42", false)
A row with a second line gets equal top and bottom padding, roomier than a single-line row, and the title/description pair stays vertically centred beside the icon — also when a container stretches the row taller, and after the description wraps onto several lines. The whole row remains one tap target.
medieval_light.Flowing rows
Put controls into wrap_row at their natural width. With wrapping left on, a button's minimum
width drops to almost nothing and the row sizes its cell by it — the label collapses to one character per line.
The factory prevents this for you.
Never leave an empty list empty
page.add_child(GoStyle.empty_state(GoIconSet.BOX, "Nothing here yet"))
People read a blank screen as broken.
Subclass hooks
Every place a child widget is constructed goes through an overridable method, so a project that subclasses gohud types can get its own subclasses inside the widgets without copying code.
| Hook | Widget | Default |
|---|---|---|
_make_scroll() | GoCoachMark, GoSurface | GoScroll.new() |
_make_close_button() | GoPromptCard, GoSurface | GoIconButton.new() |
_make_surface() | GoSheet, GoDialogs | GoSurface.new() |
_should_pause() | GoCoachMark | Hides the card while a modal is open |