NoRedInk/noredink-ui/35.8.0

NOTE: the latest version is 35.9.3

Nri.Ui.QuestionBox.V6

Patch Changes

  • Background color in Tip theme changed from white to sunshine yellow
  • added html function
  • Increase minHeight for tip question box so character fits

Changes from V5:

  • ???
view : List (Attribute msg) -> Html msg
QuestionBox.view
    [ QuestionBox.markdown "**WOW**, great component!"
    ]
type Attribute msg
id : String -> Attribute msg
markdown : String -> Attribute msg

Content inside the question box, just before the buttons, is rendered from markdown syntax

html : Html Never -> Attribute msg

Content inside the question box, just before the buttons, is rendered as HTML. We purposely don't allow the html to be interactive.

{ name : String
, icon : Svg
}
-> Attribute msg

Note that the character only appears when the theme is tip!

characterPosition : CharacterPosition -> Attribute msg
actions : List (Action msg) -> Attribute msg

Arranges the buttons vertically on the QuestionBox. This is the default behavior.

Arranges the buttons horizontally on the QuestionBox.

A neutral box that should prompt the user with a question. This is the default theme.

This dialog DOES NOT show the character icon (they should be showed as part of the CharacterStage)

A box that signifies that an answer was correct.

This dialog DOES NOT show the character icon (they should be showed as part of the CharacterStage)

A box that signifies that an answer was incorrect.

This dialog DOES NOT show the character icon (they should be showed as part of the CharacterStage)

An informational box that shows the character icon.

containerCss : List Style -> Attribute msg
leftActions : Html msg -> Attribute msg

Adds an arbitrary HTML on the left of the question box for the text to speech button

guidanceId : String -> String

This helper is how we create an id for the guidance speech bubble element based on the QuestionBox.id value. Use this helper to manage focus.

When showing multiple questions in a sequence based on the user's answer, we want to move the user's focus to the guidance so that:

  • Screenreader users are alerted to a new context -- the new question!
  • Keyboard users's focus is somewhere convenient to answer the question (but not on an answer, since we don't want accidental submissions or for the user to hit enter straight and miss the guidance!)

Modules