Button

public struct Button : Html

A wrapper for the HTML ‘button’ element.

  • The different kinds of buttons

    See more

    Declaration

    Swift

    public enum `Type`: String
  • The value for the name attribute.

    Declaration

    Swift

    public var name: String?
  • The value of the value attribute.

    Declaration

    Swift

    public var value: String?
  • The content for this button.

    Declaration

    Swift

    public var content: [Html] = []
  • The HTML string generated for the content of this element.

    Declaration

    Swift

    public var html: String
  • Create a new ‘button’ element.

    Declaration

    Swift

    public init(_ type: Type, _ klass: [String], _ id: String?)

    Parameters

    klass

    The CSS class names that configure this element

    id

    The CSS id name that configure this element

    content

    The content for this element

  • Appends the given content to the button.

    Declaration

    Swift

    public mutating func append(_ content: [Html])

    Parameters

    content

    The new content to be appended.

  • Appends the given content to the button.

    Declaration

    Swift

    public mutating func append(_ content: Html...)

    Parameters

    content

    The new content to be appended.

  • Create a new ‘button’ element of the ‘Submit’ type.

    Declaration

    Swift

    public static func submit(klass: [String] = [], name: String? = nil, value: String? = nil, _ content: [Html]) -> Button

    Parameters

    klass

    (Optional) The CSS class names that can be used to configure this element.

    name

    (Optional) The value for the name attribute.

    value

    (Optional) The value for the value attribute.

    content

    The content for this button.

    Return Value

    A new submit button.

  • Create a new ‘button’ element of the ‘Submit’ type.

    Declaration

    Swift

    public static func submit(klass: String, name: String? = nil, value: String? = nil, _ content: [Html]) -> Button

    Parameters

    klass

    The CSS class name that can be used to configures this element.

    name

    (Optional) The value for the name attribute.

    value

    (Optional) The value for the value attribute.

    content

    The content for this button.

    Return Value

    A new submit button.

  • Create a new ‘button’ element of the ‘Submit’ type.

    Declaration

    Swift

    public static func submit(klass: [String] = [], name: String? = nil, value: String? = nil, _ content: Html...) -> Button

    Parameters

    klass

    (Optional) The CSS class names that can be used to configure this element.

    name

    (Optional) The value for the name attribute.

    value

    (Optional) The value for the value attribute.

    content

    The content for this button.

    Return Value

    A new submit button.

  • Create a new ‘button’ element of the ‘Submit’ type.

    Declaration

    Swift

    public static func submit(klass: String, name: String? = nil, value: String? = nil, _ content: Html...) -> Button

    Parameters

    klass

    The CSS class name that can be used to configures this element.

    name

    (Optional) The value for the name attribute.

    value

    (Optional) The value for the value attribute.

    content

    The content for this button.

    Return Value

    A new submit button.

  • Create a new ‘button’ element of the ‘Submit’ type.

    Declaration

    Swift

    public static func submit(klass: [String] = [], name: String? = nil, value: String? = nil, title: String) -> Button

    Parameters

    klass

    (Optional) The CSS class names that can be used to configure this element.

    name

    (Optional) The value for the name attribute.

    value

    (Optional) The value for the value attribute.

    title

    The title for this button.

    Return Value

    A new submit button.

  • Create a new ‘button’ element of the ‘Submit’ type.

    Declaration

    Swift

    public static func submit(klass: String, name: String? = nil, value: String? = nil, title: String) -> Button

    Parameters

    klass

    The CSS class name that can be used to configure this element.

    name

    (Optional) The value for the name attribute.

    value

    (Optional) The value for the value attribute.

    title

    The title for this button.

    Return Value

    A new submit button.

  • Create a new ‘button’ element of the ‘Submit’ type.

    Declaration

    Swift

    public static func submit(id: String, name: String? = nil, value: String? = nil, _ content: [Html]) -> Button

    Parameters

    id

    The CSS id name that can be used to configures this element.

    name

    (Optional) The value for the name attribute.

    value

    (Optional) The value for the value attribute.

    content

    The content for this button.

    Return Value

    A new submit button.

  • Create a new ‘button’ element of the ‘Submit’ type.

    Declaration

    Swift

    public static func submit(id: String, name: String? = nil, value: String? = nil, _ content: Html...) -> Button

    Parameters

    id

    The CSS id name that can be used to configures this element.

    name

    (Optional) The value for the name attribute.

    value

    (Optional) The value for the value attribute.

    content

    The content for this button.

    Return Value

    A new submit button.

  • Create a new ‘button’ element of the ‘Submit’ type.

    Declaration

    Swift

    public static func submit(id: String, name: String? = nil, value: String? = nil, title: String) -> Button

    Parameters

    id

    The CSS id name that can be used to configures this element.

    name

    (Optional) The value for the name attribute.

    value

    (Optional) The value for the value attribute.

    title

    The title for this button.

    Return Value

    A new submit button.

  • Create a new ‘button’ element of the ‘button’ type.

    Declaration

    Swift

    public static func button(klass: [String] = [], name: String? = nil, value: String? = nil, _ content: [Html]) -> Button

    Parameters

    klass

    (Optional) The CSS class names that can be used to configure this element.

    name

    (Optional) The value for the name attribute.

    value

    (Optional) The value for the value attribute.

    content

    The content for this button.

    Return Value

    A new button.

  • Create a new ‘button’ element of the ‘button’ type.

    Declaration

    Swift

    public static func button(klass: String, name: String? = nil, value: String? = nil, _ content: [Html]) -> Button

    Parameters

    klass

    The CSS class name that can be used to configure this element.

    name

    (Optional) The value for the name attribute.

    value

    (Optional) The value for the value attribute.

    content

    The content for this button.

    Return Value

    A new button.

  • Create a new ‘button’ element of the ‘button’ type.

    Declaration

    Swift

    public static func button(klass: [String] = [], name: String? = nil, value: String? = nil, _ content: Html...) -> Button

    Parameters

    klass

    (Optional) The CSS class names that can be used to configure this element.

    name

    (Optional) The value for the name attribute.

    value

    (Optional) The value for the value attribute.

    content

    The content for this button.

    Return Value

    A new button.

  • Create a new ‘button’ element of the ‘button’ type.

    Declaration

    Swift

    public static func button(klass: String, name: String? = nil, value: String? = nil, _ content: Html...) -> Button

    Parameters

    klass

    The CSS class name that can be used to configure this element.

    name

    (Optional) The value for the name attribute.

    value

    (Optional) The value for the value attribute.

    content

    The content for this button.

    Return Value

    A new button.

  • Create a new ‘button’ element of the ‘button’ type.

    Declaration

    Swift

    public static func button(klass: [String] = [], name: String? = nil, value: String? = nil, title: String) -> Button

    Parameters

    klass

    (Optional) The CSS class names that can be used to configure this element.

    name

    (Optional) The value for the name attribute.

    value

    (Optional) The value for the value attribute.

    title

    The title for this button.

    Return Value

    A new button.

  • Create a new ‘button’ element of the ‘button’ type.

    Declaration

    Swift

    public static func button(klass: String, name: String? = nil, value: String? = nil, title: String) -> Button

    Parameters

    klass

    The CSS class name that can be used to configure this element.

    name

    (Optional) The value for the name attribute.

    value

    (Optional) The value for the value attribute.

    title

    The title for this button.

    Return Value

    A new button.

  • Create a new ‘button’ element of the ‘button’ type.

    Declaration

    Swift

    public static func button(id: String, name: String? = nil, value: String? = nil, _ content: [Html]) -> Button

    Parameters

    id

    The CSS id name that can be used to configure this element.

    name

    (Optional) The value for the name attribute.

    value

    (Optional) The value for the value attribute.

    content

    The content for this button.

    Return Value

    A new button.

  • Create a new ‘button’ element of the ‘button’ type.

    Declaration

    Swift

    public static func button(id: String, name: String? = nil, value: String? = nil, _ content: Html...) -> Button

    Parameters

    id

    The CSS id name that can be used to configure this element.

    name

    (Optional) The value for the name attribute.

    value

    (Optional) The value for the value attribute.

    content

    The content for this button.

    Return Value

    A new button.

  • Create a new ‘button’ element of the ‘button’ type.

    Declaration

    Swift

    public static func button(id: String, name: String? = nil, value: String? = nil, title: String) -> Button

    Parameters

    id

    The CSS id name that can be used to configure this element.

    name

    (Optional) The value for the name attribute.

    value

    (Optional) The value for the value attribute.

    title

    The title for this button.

    Return Value

    A new button.

  • Create a new ‘button’ element of the ‘Reset’ type.

    Declaration

    Swift

    public static func reset(klass: [String] = [], _ content: [Html]) -> Button

    Parameters

    klass

    (Optional) The CSS class names that can be used to configure this element.

    content

    The content for this button.

    Return Value

    A new reset button.

  • Create a new ‘button’ element of the ‘Reset’ type.

    Declaration

    Swift

    public static func reset(klass: String, _ content: [Html]) -> Button

    Parameters

    klass

    The CSS class name that can be used to configure this element.

    content

    The content for this button.

    Return Value

    A new reset button.

  • Create a new ‘button’ element of the ‘Reset’ type.

    Declaration

    Swift

    public static func reset(klass: [String] = [], _ content: Html...) -> Button

    Parameters

    klass

    (Optional) The CSS class names that can be used to configure this element.

    content

    The content for this button.

    Return Value

    A new reset button.

  • Create a new ‘button’ element of the ‘Reset’ type.

    Declaration

    Swift

    public static func reset(klass: String, _ content: Html...) -> Button

    Parameters

    klass

    The CSS class name that can be used to configure this element.

    content

    The content for this button.

    Return Value

    A new reset button.

  • Create a new ‘button’ element of the ‘Reset’ type.

    Declaration

    Swift

    public static func reset(klass: [String] = [], _ title: String) -> Button

    Parameters

    klass

    (Optional) The CSS class names that can be used to configure this element.

    title

    The title for this button.

    Return Value

    A new reset button.

  • Create a new ‘button’ element of the ‘Reset’ type.

    Declaration

    Swift

    public static func reset(klass: String, _ title: String) -> Button

    Parameters

    klass

    The CSS class name that can be used to configure this element.

    title

    The title for this button.

    Return Value

    A new reset button.

  • Create a new ‘button’ element of the ‘Reset’ type.

    Declaration

    Swift

    public static func reset(id: String, _ content: [Html]) -> Button

    Parameters

    id

    The CSS id name that can be used to configure this element.

    content

    The content for this button.

    Return Value

    A new reset button.

  • Create a new ‘button’ element of the ‘Reset’ type.

    Declaration

    Swift

    public static func reset(id: String, _ content: Html...) -> Button

    Parameters

    id

    The CSS id name that can be used to configure this element.

    content

    The content for this button.

    Return Value

    A new reset button.

  • Create a new ‘button’ element of the ‘Reset’ type.

    Declaration

    Swift

    public static func reset(id: String, _ title: String) -> Button

    Parameters

    id

    The CSS id name that can be used to configure this element.

    title

    The title for this button.

    Return Value

    A new reset button.