Skip to main content

Columns

Responsive multi-column layout: distributes its children into columns whose relative widths come from a layout string.

Columns lays out its visual children in a grid of columns described by layoutString: a space-separated list of relative widths, so '1 2 1' means three columns where the middle one is twice as wide as the outer ones (default '1 2 1'). Children fill the columns in order and wrap into further rows when there are more children than columns. marginX (Horizontal Gap) and marginY (Vertical Gap) set the spacing in pixels (default 16). Three things make it responsive, and they are separate: minWidth (Min Column Width) folds columns away from the end when the container is too narrow to honour the minimum; sizing set to Auto Fit ignores the layout string and takes as many equal columns of minWidth as will fit; and the Breakpoints group swaps in a different layout string entirely below mediumBreakpoint and again below smallBreakpoint. The breakpoints measure this node's own container, not the viewport, so the same Columns behaves correctly inside a sidebar, a modal or a repeater cell. The node reports which of the three it is at on onBreakpointChanged and pulses onAtMedium / onAtSmall as the container crosses a boundary, so a graph can react to a layout change without re-deriving the thresholds itself. direction flips the fill order between row and column, packing set to Masonry lets each column stack independently, and justifyContent aligns partial rows. The node warns in the editor if layoutString is bound to a non-string.

When to use it​

Card grids, dashboards, magazine-style layouts — anywhere content should reflow across a variable number of columns. For a fixed row or column of items a plain Group with flexDirection is simpler; for one instance per data record put a For Each inside the Columns.

At a glance​

CategoryVisual
Type namenet.noodl.visual.columns
Available inbrowser
SSR compatibilitysafe
Provided bynoodl-viewer-react

Inputs​

Values​

NameTypeDefaultDescription
cssClassNameString``Extra CSS class names to put on this element, for styling from a stylesheet you supply
directionEnum (row, column)rowWhether items fill across rows or down columns
justifyContentEnum (flex-start, flex-end, center)flex-startWhere the columns sit as a group when they do not fill the container
layoutStringString1 2 1Column widths as space-separated proportions, so "1 2 1" makes the middle column twice as wide
marginXNumber16Space between columns, drawn as a gutter rather than as padding on the items
marginYNumber16Space between rows
mediumBreakpointNumber—Container width below which Medium Layout replaces Layout String; this is the container, not the viewport
mediumLayoutString—Layout String to use below Medium Below; leaving it blank makes the breakpoint inert
minWidthNumber0Columns are dropped from the end rather than shrink below this; with Auto Fit it decides how many there are
mountedBooleantrueRemoves the element from the page entirely when false, unlike Visible which leaves its space behind
packingEnum (rows, masonry)rowsRows makes every item in a row as tall as the tallest; Masonry lets each column pack independently
sizingEnum (layoutString, autoFit)layoutStringLayout String sets the columns explicitly; Auto Fit derives them from Min Column Width and the space available
smallBreakpointNumber—Container width below which Small Layout replaces the others; it wins over Medium Below
smallLayoutString—Layout String to use below Small Below; leaving it blank makes the breakpoint inert. For more bands than these two, install the Advanced Columns prefab from the library — it drives these same inputs from a States node, so each band can set its own layout and gaps
styleCssString/* background-color: red; */Raw CSS declarations applied to this element, overriding the styling ports above
variantString—Name of a saved variant of this node type to apply, replacing the styling set here

Outputs​

Values​

NameTypeDefaultDescription
boundingHeightNumber—Height this element actually ended up with after layout, in pixels
boundingWidthNumber—Width this element actually ended up with after layout, in pixels
childIndexNumber—This element's position among its parent's children, counting from 0
childrenCountNumber—How many child elements are currently mounted inside this one
onBreakpointChangedString—Which layout is in force: Default, Medium or Small. It is Default until the node has been measured, and while Column Sizing is Auto Fit, where no layout string is used
screenPositionXNumber—Distance in pixels from the left edge of the window to this element's left edge
screenPositionYNumber—Distance in pixels from the top edge of the window to this element's top edge
thisReference—A reference to this node itself, for ports that take a node rather than a value

Signals​

NameTypeDefaultDescription
didMountSignal—Fires once this element has been added to the page and can be measured
onAtMediumSignal—Fires when the container narrows or widens into the Medium band, once per crossing
onAtSmallSignal—Fires when the container narrows or widens into the Small band, once per crossing
willUnmountSignal—Fires just before this element is removed from the page, while it still exists

Patterns​

  • Responsive card grid: layoutString '1 1 1' + minWidth ~200 so three columns collapse to two, then one, as the viewport narrows.
  • Named breakpoints: layoutString '1 2 1' with mediumLayout '1 1' below 1024 and smallLayout '1' below 600 — three explicit layouts rather than a fold from the end.
  • React to the band: wire onBreakpointChanged into a Text node, or onAtSmall into an action, instead of re-deriving the thresholds from a States node on boundingWidth.
  • For Each inside Columns: repeated component instances distribute across the columns automatically.

Examples​

Media card row: Columns layout with Image, Icon and Circle

A card layout composed from the visual primitives: Columns (net.noodl.visual.columns) distributes its children by a layout string ('1 2' — the second column twice as wide), the Image shows a picture from a URL/asset on src, the Icon (net.noodl.visual.icon) renders a themed glyph, and the Circle doubles as a status dot whose fillColor is data-driven. Layout is containment; only the dynamic bits (image source, status color) are wired.

Group, Repeater

Generated

This page is generated from node-catalog-enriched.json. Do not edit it by hand — run npm run docs:nodes to regenerate, and fix the source enrichment instead.