Classes

The following classes are available globally.

  • This class is responsible for managing attributes of HTML elements

    See more

    Declaration

    Swift

    public final class Attribute
  • Define a base class to containered tag elements

    See more

    Declaration

    Swift

    public class ContainerElementBase : GenericElement
  • Base Class for all HTML elements implement

    See more

    Declaration

    Swift

    public class GenericElement : ElementProtocol
  • This is a Base class for Input Elements

    See more

    Declaration

    Swift

    public class InputElementBase : GenericElement
  • This is a Base class for Table Column Elements

    See more

    Declaration

    Swift

    public class TableColumnBase : GenericElement
  • This is a Base class for Table Row Elements

    See more

    Declaration

    Swift

    public class TableRowBase : GenericElement
  • This is a Base class for Typography Elements

    See more

    Declaration

    Swift

    public class TypographyElementBase : GenericElement
  • Undocumented

    See more

    Declaration

    Swift

    public final class CompositeElements : ElementProtocol
  • A

    A tag element class

    Usage Example:

     let link = Link(("href","https://micheltlutz.me"), ("target","_blank"))
     link.add("Developed by Michel Lutz - micheltlutz.me 🚀")
    
    See more

    Declaration

    Swift

    public final class A : ContainerElementBase
  • Blockquote tag element class

    Usage Example:

    let description = Blockquote()
    description.add("This is Typography blockquote demo.")
    
    See more

    Declaration

    Swift

    public final class Blockquote : ContainerElementBase
  • Br

    Br tag element class

    Usage Example:

     Br()
    
    See more

    Declaration

    Swift

    public final class Br : GenericElement
  • Button tag element class

    Usage Example:

     let section = Section(("id","buttons"), ("class","container"))
    
     let title = H3("Buttons")
     title.addAttribute(("class","title"))
     section.add(title)
    
     let description = Blockquote()
     description.add("This is Buttons demo.")
     section.add(description)
    
     let linkButton = Link(("href","#"), ("class","button"))
     linkButton.add("Default Button")
     section.add(linkButton)
    
     let button = Button("Outlined Button")
     button.addAttribute(("class","button button-outline") )
     section.add(button)
    
     let inputSubmit = Submit("Clear Button")
     inputSubmit.addAttribute(("class","button button-clear") )
     section.add(section.add(inputSubmit))
    
     return section
    
    See more

    Declaration

    Swift

    public class Button : TypographyElementBase
  • Canvas tag element class

    See more

    Declaration

    Swift

    public final class Canvas : ContainerElementBase
  • Center tag element class

    See more

    Declaration

    Swift

    public final class Center : ContainerElementBase
  • Code tag element class

    See more

    Declaration

    Swift

    public final class Code : TypographyElementBase
  • Div

    Div tag element class

    ### Usage Example: ###

      let div = Div(("class", "float-right"))
      div.add("Test Div")
    
    See more

    Declaration

    Swift

    public final class Div : ContainerElementBase
  • Body tag element class

    Usage Example:

    let body = Body()
    body.add(/* Any Element
    
    See more

    Declaration

    Swift

    public final class Body : ContainerElementBase
  • DOCTYPE tag element class

    Usage Example:

    let doctype = Doctype()
    doctype.getString() // or doctype.generate()
    
    See more

    Declaration

    Swift

    public final class Doctype : ElementProtocol
  • Head tag element class

    Usage Example:

    let head = Head()
    head.add(/* Any Element
    
    See more

    Declaration

    Swift

    public final class Head : ContainerElementBase
  • Html tag element class

    ### Usage Example: ###

     let html = Html()
     html.add(/* Any Element
    
    See more

    Declaration

    Swift

    public final class Html : ContainerElementBase
  • Link stylesheet tag element class

    Usage Example:

     let linkCssTag = LinkStylesheet("/styles/milligram.min.css")
    
    See more

    Declaration

    Swift

    public class LinkStylesheet : Link
  • link tag element class

    Usage Example:

    let linkTag = Link("/styles/milligram.min.css", attributes: ("rel", "stylesheet"))
    
    See more

    Declaration

    Swift

    public class Link : GenericElement
  • Meta tag element class

    Usage Example:

     let meta = Meta(("charset", "utf-8")))
    
    See more

    Declaration

    Swift

    public class Meta : GenericElement
  • This class define a Script element

    Usage Example:

    let script = Script()
    script.add("var myJsVar = 1")
    
    let script = Script(("src","myScript.js"))
    
    See more

    Declaration

    Swift

    public final class Script : GenericElement
  • title tag element class

    Usage Example:

     let pageTitle = Title("This is Page.")
    
    See more

    Declaration

    Swift

    public final class Title : ContainerElementBase
  • Em

    Emphasis tag element class

    ### Usage Example: ###

      Em("Emphasis")
    
    See more

    Declaration

    Swift

    public final class Em : TypographyElementBase
  • Fieldset tag element class

    ### Usage Example: ###

      let fieldset = Fieldset()
    
      let labelName = Label("Name")
      labelName.addAttribute(("for", "nameField"))
      fieldset.add(labelName)
    
      let inputName = InputText("", id: "nameField", placeholder: "Name")
      fieldset.add(inputName)
    
      let labelAge = Label("Age Range")
      labelAge.addAttribute(("for", "ageRangeField"))
      fieldset.add(labelAge)
    
    See more

    Declaration

    Swift

    public final class Fieldset : GenericElement
  • footer tag element class

    Usage Example:

    let footer = Footer()
    footer.add(/* Any Element
    
    See more

    Declaration

    Swift

    public final class Footer : ContainerElementBase
  • Form tag element class

    ### Usage Example: ###

      let form = Form((("method"),("POST")))
      let fieldset = Fieldset()
    
      let labelName = Label("Name")
      labelName.addAttribute(("for", "nameField"))
      fieldset.add(labelName)
    
      let inputName = InputText("", id: "nameField", placeholder: "Name")
      fieldset.add(inputName)
    
      let labelAge = Label("Age Range")
      labelAge.addAttribute(("for", "ageRangeField"))
      fieldset.add(labelAge)
    
      form.add(fieldset)
    
    See more

    Declaration

    Swift

    public final class Form : GenericElement

H1

H2

H3

H4

H5

H6

  • H6

    H6 tag element class

    ### Usage Example: ###

      H6("Heading H6")
    
    See more

    Declaration

    Swift

    public final class H6 : TypographyElementBase
  • header tag element class

    Usage Example:

    let header = Header()
    header.add(/* Any Element
    
    See more

    Declaration

    Swift

    public final class Header : ContainerElementBase
  • Hr

    Hr tag element class

    ### Usage Example: ###

      Hr()
    
    See more

    Declaration

    Swift

    public final class Hr : GenericElement
  • Img

    Img tag element class

    ### Usage Example: ###

      let img = Img("images/banner.png")
    
    See more

    Declaration

    Swift

    public final class Img : GenericElement
  • Class define a input type checkbox

    ### Usage Example: ###

      Checkbox("confirmField", id: "confirmField")
    
    See more

    Declaration

    Swift

    public final class Checkbox : InputElementBase
  • Class define a input type text

    ### Usage Example: ###

     InputText("value", id: "nameField", placeholder: "Name")
    
    See more

    Declaration

    Swift

    public final class InputText : InputElementBase
  • This class define a option select element

    See more

    Declaration

    Swift

    public final class Option : GenericElement
  • This class define a select element

    ### Usage Example: ###

     let select = Select([["0-13": "0-13"],
                         ["14-17": "14-17"],
                         ["18-23": "18-23"]],
                         attr:("id", "ageRangeField"))
    
    See more

    Declaration

    Swift

    public final class Select : GenericElement
  • This class define a submit element

    ### Usage Example: ###

     let inputSubmit = Submit("Send")
     inputSubmit.addAttribute(("class","button-primary"))
    
    See more

    Declaration

    Swift

    public class Submit : InputElementBase
  • This class define a Textarea element

    ### Usage Example: ###

     let textArea = Textarea(("placeholder", "Hi Mike …"), ("id", "commentField"))
     textArea.add("My Text")
    
    See more

    Declaration

    Swift

    public final class Textarea : GenericElement
  • Label tag element class

    ### Usage Example: ###

      let labelComment = Label("Comment")
      labelComment.addAttribute(("for", "commentField"))
    
    See more

    Declaration

    Swift

    public final class Label : TypographyElementBase
  • DD

    Class for description list item

    See more

    Declaration

    Swift

    public class DD : LI
  • DL

    Class for description list

    ### Usage Example: ###

      let dl = DL()
      dl.add("Description list item 1")
      let dd = DD("Description list item 1.1")
      dl.add(dd)
    
    See more

    Declaration

    Swift

    public final class DL : UL
  • DT

    Class for description list item

    See more

    Declaration

    Swift

    public class DT : LI
  • LI

    Class for list item

    See more

    Declaration

    Swift

    public class LI : GenericElement
  • OL

    Class for ordered list

    ### Usage Example: ###

      let ol = OL()
      ol.add("Ordered list item 1")
      ol.add("Ordered list item 2")
    
    See more

    Declaration

    Swift

    public final class OL : UL
  • UL

    Class for Unordered list

    ### Usage Example: ###

      let ul = UL()
      ul.add("Unordered list item 1")
      ul.add("Unordered list item 2")
    
    See more

    Declaration

    Swift

    public class UL : GenericElement
  • Main tag element class

    ### Usage Example: ###

      let main = Main(("class","wrapper"))
      main.add(Hr())
    
    See more

    Declaration

    Swift

    public final class Main : ContainerElementBase
  • P

    P tag element class

    ### Usage Example: ###

      let paragraph = P()
      paragraph.add("This is Typography Paragraph demo.")
    
    See more

    Declaration

    Swift

    public final class P : TypographyElementBase
  • Pre

    Pre tag element class

    See more

    Declaration

    Swift

    public final class Pre : TypographyElementBase
  • Section tag element class

    ### Usage Example: ###

      let section = Section(("id","typography"), ("class","container"))
      section.add(H3("Typography"))
    
    See more

    Declaration

    Swift

    public final class Section : ContainerElementBase
  • Small tag element class

    ### Usage Example: ###

      Small("Text Small")
    
    See more

    Declaration

    Swift

    public class Small : TypographyElementBase
  • Strong tag element class

    ### Usage Example: ###

      Strong("Text Strong")
    
    See more

    Declaration

    Swift

    public final class Strong : TypographyElementBase
  • Tbody tag element class

    See more

    Declaration

    Swift

    public final class TBody : TableRowBase
  • THead tag element class

    See more

    Declaration

    Swift

    public final class THead : TableRowBase
  • Table html tag class element

    ### Usage Example: ###

      let table = Table()
      table.tableHeaders(titles: ["Name", "Age", "Height", "Location"])
      //table.tableHeaders(titles: ["Name", "Age", "Height", "Location"], aligns: ["center", "left", "left", "left"]) // Align Headers
    
      table.addRow()
      table.addInRow("Arthurito Thompson")
      table.addInRow("52")
      table.addInRow("1,30")
      table.addInRow("Torresmo, RS")
      table.addRow()
      table.addInRow("Stephen Curry")
      table.addInRow("27")
      table.addInRow("1,91")
      table.addInRow("Akron, OH")
      table.addRow()
      table.addInRow("Klay Thompson")
      table.addInRow("25")
      table.addInRow("2,01")
      table.addInRow("Los Angeles, CA")
    
    See more

    Declaration

    Swift

    public final class Table : GenericElement
  • Td

    Td tag element class

    See more

    Declaration

    Swift

    public final class Td : ContainerElementBase
  • Th

    Th tag element class

    See more

    Declaration

    Swift

    public final class Th : TableColumnBase
  • Tr

    Tr tag element class

    See more

    Declaration

    Swift

    public final class Tr : TableRowBase
  • Make a simple text Element to append in others elements

    ### Usage Example: ###

      Text("Simple Text")
    
    See more

    Declaration

    Swift

    public final class Text : ElementProtocol
  • U

    Underline tag element class

    ### Usage Example: ###

      U("Underline Text")
    
    See more

    Declaration

    Swift

    public final class U : TypographyElementBase