Godot ui containers

From nix-community/nur-combined · View interactive version

Godot ui containers is an AI agent skill from the GitHub repository nix-community/nur-combined. Expert blueprint for responsive UI layouts using Container nodes (HBoxContainer, VBoxContainer, GridContainer, MarginContainer, ScrollContainer). Covers size flags, anchors, split containers, and dynamic layouts. Use when building adaptive interfaces OR implementing responsive menus. Keywords Contai

How to use this skill

Skill file

UI Containers

Container auto-layout, size flags, anchors, and split ratios define responsive UI systems.

Available Scripts

[responsive_layout_builder.gd](scripts/responsive_layout_builder.gd)

Expert container builder with breakpoint-based responsive layouts.

[responsive_grid.gd](scripts/responsive_grid.gd)

Auto-adjusting GridContainer that changes column count based on available width.

[responsive_inventory_grid.gd](scripts/responsive_inventory_grid.gd)

Expert logic for dynamic Grid columns based on available width and item minimum size.

[terminal_autoscroll.gd](scripts/terminal_autoscroll.gd)

Safe ScrollContainer management. Handles the common "one-frame delay" bug when adding logs or chat.

[viewport_3d_preview.gd](scripts/viewport_3d_preview.gd)

High-performance 3D-in-UI setup. Uses stretch_shrink and transparent_bg for character previews.

[dynamic_tab_manager.gd](scripts/dynamic_tab_manager.gd)

Pattern for dynamic tab spawning, custom titles, and tab closing logic.

[responsive_tag_cloud.gd](scripts/responsive_tag_cloud.gd)

Wrapping item lists using HFlowContainer, essential for tag clouds and responsive menus.

[performance_anchor_layout.gd](scripts/performance_anchor_layout.gd)

Optimization architecture. Replaces deep container nesting with lightweight Anchor and Offset logic.

[custom_radial_container.gd](scripts/custom_radial_container.gd)

Expert custom container logic implementing a radial/circle layout via NOTIFICATION_SORT_CHILDREN.

[animated_container_shuffle.gd](scripts/animated_container_shuffle.gd)

Dynamic sibling reordering and animation logic for interactive UI lists.

[aspect_ratio_mini_map.gd](scripts/aspect_ratio_mini_map.gd)

Enforcing strict aspect ratios (e.g. 1:1, 16:9) across fluid window resizes using AspectRatioContainer.

[container_size_flags_pro.gd](scripts/container_size_flags_pro.gd)

Advanced sizing logic using SIZE_EXPAND_FILL and stretch_ratio for weighted layouts.

NEVER Do in UI Containers


# VBoxContainer example
# Automatically stacks children vertically
# Children:
#   Button ("Play")
#   Button ("Settings")
#   Button ("Quit")

# Set separation between items
$VBoxContainer.add_theme_constant_override("separation", 10)

Responsive Layout

# Use anchors and size flags
func _ready() -> void:
    # Expand to fill parent
    $MarginContainer.set_anchors_preset(Control.PRESET_FULL_RECT)
    
    # Add margins
    $MarginContainer.add_theme_constant_override("margin_left", 20)
    $MarginContainer.add_theme_constant_override("margin_right", 20)

SizeFlags

# Control how children expand in containers
button.size_flags_horizontal = Control.SIZE_EXPAND_FILL
button.size_flags_vertical = Control.SIZE_SHRINK_CENTER

Reference

Related

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.