Class MjCarousel
java.lang.Object
dev.jcputney.mjml.component.BaseComponent
dev.jcputney.mjml.component.BodyComponent
dev.jcputney.mjml.component.interactive.MjCarousel
The carousel component (
<mj-carousel>). Uses CSS radio buttons to implement a pure-CSS
image carousel with previous/next navigation and thumbnail strips. Generates unique hex IDs per
instance and injects carousel CSS into the global context.
The output matches the official MJML v4.18.0 carousel structure: radio inputs for state, sibling combinator CSS for toggling visibility, thumbnail anchors with labels, and table-based main content with previous/next icon columns.
-
Field Summary
Fields inherited from class BaseComponent
globalContext, node, renderContext -
Constructor Summary
ConstructorsConstructorDescriptionMjCarousel(MjmlNode node, GlobalContext globalContext, RenderContext renderContext, ComponentRegistry registry) -
Method Summary
Modifier and TypeMethodDescriptionReturns the default attribute values for this component.Returns the MJML tag name this component handles.render()Renders this component to HTML.Methods inherited from class BodyComponent
addBorderStyles, addIfPresent, addIfPresent, buildAttributes, buildResponsiveClass, buildStyle, escapeAttr, escapeHref, getBoxModel, getChildrenByTags, getContentWidth, orderedMap, parseWidth, registerMediaQuery, renderChildren, resolveShorthandSide, sanitizeContent, sanitizeHrefMethods inherited from class BaseComponent
getAttribute, getAttribute, getNode
-
Constructor Details
-
MjCarousel
public MjCarousel(MjmlNode node, GlobalContext globalContext, RenderContext renderContext, ComponentRegistry registry)
-
-
Method Details
-
getTagName
Description copied from class:BaseComponentReturns the MJML tag name this component handles.- Specified by:
getTagNamein classBaseComponent- Returns:
- the MJML tag name
-
getDefaultAttributes
Description copied from class:BaseComponentReturns the default attribute values for this component.- Specified by:
getDefaultAttributesin classBaseComponent- Returns:
- a map of attribute names to their default values
-
render
Description copied from class:BodyComponentRenders this component to HTML.- Specified by:
renderin classBodyComponent- Returns:
- the rendered HTML string
-