Widgets

Column

Column

A vertical layout control for stacking children.

Example

column(
  spacing: 12,
  children: [
    text(value: "Title", style: { size: 24 }),
    text(value: "Subtitle"),
    text_field(label: "Name")
  ]
)

Common properties

  • children
  • spacing
  • expand
  • horizontal_alignment
  • scroll

Usage

page.add(
  column(
    spacing: 10,
    children: [
      text(value: "Profile"),
      text_field(label: "Display name")
    ]
  )
)

Notes

  • children should be an array of controls
  • column is one of the most common layout primitives in Ruflet apps

Complete API

Helpers

  • column(children = ..., **props, &block)

Accepted properties

  • adaptive — Adapts to the platform (Material/Cupertino) when true.
  • align — Alignment of the control within its parent.
  • alignment — Alignment of the content within the control.
  • animate_align — Animates alignment changes.
  • animate_margin — Animates margin changes.
  • animate_offset — Animates offset changes.
  • animate_opacity — Animates opacity changes.
  • animate_position — Animates position changes.
  • animate_rotation — Animates rotation changes.
  • animate_scale — Animates scale changes.
  • animate_size — Animates size changes.
  • aspect_ratio — Width-to-height ratio to maintain.
  • auto_scroll — Sets the auto scroll property.
  • badge — Badge drawn on the corner of the control.
  • bottom — Bottom offset when positioned inside a stack.
  • col — Responsive column span (1-12) per breakpoint.
  • controls — The list of child controls.
  • data — Arbitrary value you can attach to the control and read back in handlers.
  • disabled — Disables interaction when true.
  • expand — Fills the available space along the parent's main axis when true.
  • expand_loose — Like expand, but only grows up to the child's natural size.
  • height — Fixed height in logical pixels.
  • horizontal_alignment — Horizontal alignment.
  • intrinsic_width — Intrinsic width.
  • key — Stable identity used to preserve state across rebuilds.
  • left — Left offset when positioned inside a stack.
  • margin — Outer spacing around the control.
  • offset — Translation offset applied to the control.
  • opacity — Opacity from 0.0 (transparent) to 1.0 (opaque).
  • right — Right offset when positioned inside a stack.
  • rotate — Rotation applied to the control.
  • rtl — Renders right-to-left when true.
  • run_alignment — Run alignment.
  • run_spacing — Sets the run spacing property.
  • scale — Scale transform applied to the control.
  • scroll — Sets the scroll property.
  • scroll_interval — Sets the scroll interval property.
  • size_change_interval — Throttle interval for on_size_change, in ms.
  • spacing — Sets the spacing property.
  • tight — Sets the tight property.
  • tooltip — Text shown on hover/long-press.
  • top — Top offset when positioned inside a stack.
  • visible — Hides the control when false.
  • width — Fixed width in logical pixels.
  • wrap — Sets the wrap property.

Events

  • on_animation_end — Fired when an animation completes.
  • on_scroll — Fired when the scroll position changes.
  • on_size_change — Fired when the control's size changes.

Wire reference

  • Family: shared
  • Widget type: column