Class Header
java.lang.Object
io.mindspice.simplypages.core.HtmlTag
io.mindspice.simplypages.components.Header
- All Implemented Interfaces:
Component
Heading component (H1-H6) with alignment and optional decorative bars.
Mutable and not thread-safe. Content and decoration state are composed on this instance. Mutate within a request-scoped flow. For reuse, stop mutating and render as a stable structure with per-request slot/context values.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class HtmlTag
attributes, children, id, innerText, innerTextSlot, selfClosing, tagName, trustedHtml -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncenter()Aligns header text to the center.getLevel()getText()static Headerstatic Headerstatic Headerstatic Headerstatic Headerstatic Headerjustify()Justifies header text.left()Aligns header text to the left (default).render()Renders this component with an empty context.render(RenderContext context) Renders opening tag, text payload, child output, and closing tag.right()Aligns header text to the right.Adds a default horizontal divider below the header.withBottomBar(Component divider) Adds a custom divider below the header.Alias forHtmlTag.addClass(String).Sets the HTML id attribute for this header.Adds a default horizontal divider above the header.withTopBar(Component divider) Adds a custom divider above the header.Methods inherited from class HtmlTag
addClass, addStyle, addTrustedStyle, getChildrenStream, getId, hxDelete, hxGet, hxInclude, hxPatch, hxPost, hxPushUrl, hxPut, hxScrollTargetTop, hxSwap, hxTarget, hxTrigger, withAttribute, withChild, withInnerText, withInnerText, withMaxWidth, withMinWidth, withUnsafeHtml, withWidth
-
Constructor Details
-
Header
-
-
Method Details
-
H1
-
H2
-
H3
-
H4
-
H5
-
H6
-
withId
Sets the HTML id attribute for this header.When set, this id will be applied to the DOM element, allowing targeting via CSS selectors, JavaScript, or HTMX.
-
getText
-
getLevel
-
withClass
-
left
Aligns header text to the left (default). -
center
Aligns header text to the center. -
right
Aligns header text to the right. -
justify
Justifies header text. -
withTopBar
Adds a default horizontal divider above the header. -
withTopBar
-
withBottomBar
Adds a default horizontal divider below the header. -
withBottomBar
-
render
Description copied from class:HtmlTagRenders opening tag, text payload, child output, and closing tag.Security contract: slot and plain text are escaped; trusted HTML payload is emitted verbatim.
-
render
-