Class Grid
java.lang.Object
io.mindspice.simplypages.core.HtmlTag
io.mindspice.simplypages.layout.Grid
- All Implemented Interfaces:
Component
Generic CSS-class driven grid container.
Mutable and not thread-safe. The instance stores column and gap state and rewrites class attributes in place when configuration changes; keep instances request-scoped and avoid concurrent reuse.
-
Field Summary
FieldsFields inherited from class HtmlTag
attributes, children, id, innerText, innerTextSlot, selfClosing, tagName, trustedHtml -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAppends one grid item.Appends multiple grid items in argument order.static Gridcreate()Factory for a standard grid.withColumns(int columns) Sets column count and rewrites derived classes.Sets gap token and rewrites derived classes.Methods inherited from class HtmlTag
addClass, addStyle, addTrustedStyle, getChildrenStream, getId, hxDelete, hxGet, hxInclude, hxPatch, hxPost, hxPushUrl, hxPut, hxScrollTargetTop, hxSwap, hxTarget, hxTrigger, render, withAttribute, withChild, withClass, withId, withInnerText, withInnerText, withMaxWidth, withMinWidth, withUnsafeHtml, withWidth
-
Field Details
-
columns
protected int columns -
gap
-
baseClass
-
-
Constructor Details
-
Grid
public Grid()Creates a grid with base classgrid, 3 columns, andmediumgap. -
Grid
Creates a grid with a custom base class.- Parameters:
baseClass- required base class token always retained on updates
-
-
Method Details
-
create
-
withColumns
Sets column count and rewrites derived classes.- Parameters:
columns- number of columns used ingrid-cols-<n>- Returns:
- this grid
-
withGap
-
addItem
-
addItems
-