Skip to main content

Variable: layout

const layout: object

One-shot positioning without DOM containers.

Type Declaration​

NameTypeDescription
above()(elements: ReactiveElementBase | ReactiveElementBase[], target: ReactiveElementBase, options?: RelativeLayoutOptions) => voidPlace above a target; gap defaults to 3 stage units.
align()(elements: ReactiveElementBase[], options?: AlignmentOptions) => voidAlign existing elements within their combined bounds or a region. Default: left edges.
below()(elements: ReactiveElementBase | ReactiveElementBase[], target: ReactiveElementBase, options?: RelativeLayoutOptions) => voidPlace below a target; gap defaults to 3 stage units.
circle()(elements: ReactiveElementBase[], options?: CircleLayoutOptions) => voidArrange around a center; radius defaults to 28 stage units.
grid()(matrix: GridSlot[][], options?: LayoutOptions) => DOMElement[]Arrange cells in rows. Default gaps: 4 stage units; alignment: start on both axes.
group()(elements: ReactiveElementBase[], options?: GroupLayoutOptions) => voidMove and scale current geometry together; scale is a relative multiplier (default: 1).
hstack()(elements: StackSlot[], options?: StackLayoutOptions) => DOMElement[]Arrange a row; nested arrays form columns. Default gaps: 6 horizontal, 3 vertical stage units.
leftOf()(elements: ReactiveElementBase | ReactiveElementBase[], target: ReactiveElementBase, options?: RelativeLayoutOptions) => voidPlace left of a target; gap defaults to 3 stage units.
rightOf()(elements: ReactiveElementBase | ReactiveElementBase[], target: ReactiveElementBase, options?: RelativeLayoutOptions) => voidPlace right of a target; gap defaults to 3 stage units.
vstack()(elements: StackSlot[], options?: StackLayoutOptions) => DOMElement[]Arrange a column; nested arrays form rows. Default gaps: 6 horizontal, 3 vertical stage units.