NoRedInk/noredink-ui/15.6.0

NOTE: the latest version is 35.9.3

Nri.Ui.Heading.V2

Patch changes:

- adds `nriDescription`, `testId`, and `id` helpers

Headings with customization options for accessibility.

h1 : List (Attribute msg) -> List (Html msg) -> Html msg

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

h2 : List (Attribute msg) -> List (Html msg) -> Html msg

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

h3 : List (Attribute msg) -> List (Html msg) -> Html msg

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

h4 : List (Attribute msg) -> List (Html msg) -> Html msg

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

h5 : List (Attribute msg) -> List (Html msg) -> Html msg

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

type Attribute msg

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

Select which of the base styles this heading should look like. Each of h1..5 has a default, check their docs to see if you don't need to override this.

type Style
= Top
| Tagline
| Subhead
| Small

Use this when the header is on top of a section in an error state.

errorIf : Bool -> Attribute msg

Show an error if some condition is met.

Heading.h1
    [ Heading.errorIf (model.errorMessage /= Nothing) ]
    [ Html.text "Hello! ]
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. Now you can!

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

Please prefer custom for API consistency.