NoRedInk/noredink-ui/21.3.0

NOTE: the latest version is 35.9.3

Nri.Ui.Heading.V3

Changelog

Patch changes

  • use internal Content module

Changes from V2:

  • changes default h2 style to subhead
  • remove customAttr
  • remove error and errorIf
  • replaces style with top, subhead, and small
  • replaces list of HTML attributes with content approach (plaintext, markdown, html) used in Text

Headings with customization options.

h1 : List (Attribute msg) -> Html msg

Make a first-level heading (styled like a top-level heading by default.)

h2 : List (Attribute msg) -> Html msg

Make a second-level heading (styled like a tagline by default.)

h3 : List (Attribute msg) -> Html msg

Make a third-level heading (styled like a subhead by default.)

h4 : List (Attribute msg) -> Html msg

Make a fourth-level heading (styled like a small heading by default.)

h5 : List (Attribute msg) -> Html msg

Make a fifth-level heading (styled like a small heading by default.)

Content

plaintext : String -> Attribute msg

Provide a plain-text string.

markdown : String -> Attribute msg

Provide a string that will be rendered as markdown.

html : List (Html msg) -> Attribute msg

Provide a list of custom HTML.

Customizations

type Attribute msg

Like an Html.Attribute msg, but specifically for headings. Use things like style in this module to construct an Attribute.

top headings are Colors.navy and have:

font-size: 30px
font-weight: 700

By default.

subhead headings are Colors.navy and have:

font-size: 20px
font-weight: 700

By default.

small headings are Colors.gray20 and have:

font-size: 16px
font-weight: 700

By default.

small heading default styles also make the letter-spacing slightly narrower, by 0.13px.

custom : List (Attribute msg) -> Attribute msg

Set some custom attributes.

Please don't make headers interactive! Use buttons or links instead so that keyboard and screen reader users can use the site too.

For style customizations, be sure to use the Heading.css helper.

css : List Style -> Attribute msg

Set some custom CSS in this heading. For example, maybe you need to tweak margins.

nriDescription : String -> Attribute msg
testId : String -> Attribute msg
id : String -> Attribute msg