column Widget

A column arranges its child widgets in a vertical column.

Attributes:

  • widgets: [Widget]
    • Required
    • Widgets to display, in order starting with the top
    • May be empty
  • alignment: "start"
    • Align widgets with the left side of the column widget.
    • Default
  • alignment: "center"
    • Align widgets with the center of the column widget.
  • alignment: "end"
    • Align widgets with the right side of the column widget.
  • spacing: n
    • Separate widgets by N device-independent pixels

Example

screenshot

# Ruby
nav_page(title: "Column") {
  scroll {
    column(widgets: [
      text("text1"),
      text("text2"),
      text("text3"),
    ])
  }
}
#![allow(unused)]
fn main() {
// Rust
nav_page(
    "Column",
    scroll(column((text("text1"), text("text2"), text("text3")))),
)
}

Other Options

screenshot

# Ruby
nav_page(title: "Column") {
  scroll {
    column(widgets: [
      form_section(title: "Default", widgets: [
        column(widgets: [
          text("text"),
          text("text"),
        ])
      ]),
      form_section(title: "Start", widgets: [
        column(align: ALIGN_START, widgets: [
          text("text"),
          text("text"),
        ])
      ]),
      form_section(title: "Center", widgets: [
        column(align: ALIGN_CENTER, widgets: [
          text("text"),
          text("text"),
        ])
      ]),
      form_section(title: "End", widgets: [
        column(align: ALIGN_END, widgets: [
          text("text"),
          text("text"),
        ])
      ]),
      form_section(title: "Spacing", widgets: [
        column(spacing: 16.0, widgets: [
          text("text"),
          text("text"),
        ])
      ]),
    ])
  }
}
#![allow(unused)]
fn main() {
// Rust
nav_page(
    "Column",
    scroll(column((
        form_section("Default", column((text("text"), text("text")))),
        form_section(
            "Start",
            column((text("text"), text("text"))).with_alignment(HAlignment::Start),
        ),
        form_section(
            "Center",
            column((text("text"), text("text"))).with_alignment(HAlignment::Center),
        ),
        form_section(
            "End",
            column((text("text"), text("text"))).with_alignment(HAlignment::End),
        ),
        form_section(
            "Spacing",
            column((text("text"), text("text"))).with_spacing(16),
        ),
    ))),
)
}