Class MjSocialElement


public class MjSocialElement extends BodyComponent
A single social element (<mj-social-element>). Renders a table containing a social icon image and an optional text label. When used in horizontal mode, each element is wrapped in its own inline table. When used in vertical mode, each element is a row in the parent's shared table.
  • Constructor Details

  • Method Details

    • getTagName

      public String getTagName()
      Description copied from class: BaseComponent
      Returns the MJML tag name this component handles.
      Specified by:
      getTagName in class BaseComponent
      Returns:
      the MJML tag name
    • getDefaultAttributes

      public Map<String,String> getDefaultAttributes()
      Description copied from class: BaseComponent
      Returns the default attribute values for this component.
      Specified by:
      getDefaultAttributes in class BaseComponent
      Returns:
      a map of attribute names to their default values
    • render

      public String render()
      Description copied from class: BodyComponent
      Renders this component to HTML.
      Specified by:
      render in class BodyComponent
      Returns:
      the rendered HTML string
    • renderHorizontal

      public String renderHorizontal(MjSocial parent)
      Renders this element in horizontal mode (each element in its own inline table).
      Parameters:
      parent - the parent MjSocial component, or null if rendering standalone
      Returns:
      the rendered HTML string for this social element in horizontal layout
    • renderVertical

      public String renderVertical(MjSocial parent)
      Renders this element in vertical mode (a single row in the parent's shared table).
      Parameters:
      parent - the parent MjSocial component, or null if rendering standalone
      Returns:
      the rendered HTML string for this social element in vertical layout