nsbno / spor-elm / Spor.Heading

A component for displaying headers


type Heading

A component for displaying headers


type HeadingLevel
    = H1
    | H2
    | H3
    | H4
    | H5
    | H6

What Html element to use for the header. Use H1 for most important, H2 for second most important etc.

Config

init : Heading

Create an initial configuration for a Heading component. By default, the H2 level is used, along with the Medium text style.

withHeadingLevel : HeadingLevel -> Heading -> Heading

Set the heading level

withTextStyle : Spor.TextStyle.TextStyle -> Heading -> Heading

Set the text style

withText : String -> Heading -> Heading

Set the text to be displayed

Display

toHtml : Heading -> Html.Styled.Html a

Convert configuration to HTML