NoRedInk/noredink-ui/5.9.1

NOTE: this package is not compatible with Elm 0.19.1

Nri.Ui.Button.V1

Common NoRedInk buttons. For accessibility purposes, buttons that perform an action on the current page should be HTML <button> elements and are created here with *Button functions. Buttons that take the user to a new page should be HTML <a> elements and are created here with *Link functions. Both versions should be able to use the same CSS class in all cases.

There will generally be a *Button and *Link version of each button style. (These will be created as they are needed.)

Required styles

styles : Styles Never CssClasses msg

Required CSS styles for Nri.Ui.Button.

Common configs

type alias ButtonContent =
{ label : String
, state : ButtonState
}

ButtonContent, often changes based on ButtonState. For example, a button in the "Success" state may have a different label than a button in the "Error" state

= Tiny
| Small
| Medium
| Large

Sizes for buttons that have button classes

NOTE: if you add a size here, you need to add Css styles using the sizeStyle helper in the styles definition.

= Enabled
| Unfulfilled
| Disabled
| Error
| Loading
| Success

Describes the state of a button. Has consequences for appearance and disabled attribute.

  • Enabled: An enabled button. Takes the appearance of ButtonStyle
  • Unfulfilled: A button which appears with the InactiveColors palette but is not disabled.
  • Disabled: A button which appears with the InactiveColors palette and is disabled.
  • Error: A button which appears with the ErrorColors palette and is not disabled.
  • Loading: A button which appears with the LoadingColors palette and is disabled
  • Success: A button which appears with the InactiveColors palette and is disabled
= Primary
| Secondary
| Borderless
| Danger

Styleguide-approved styles for your buttons!

Note on borderless buttons: A borderless button that performs an action on the current page This button is intended to look like a link. Only use a borderless button when the clickable text in question follows the same layout/margin/padding as a bordered button

<button> Buttons

button : ButtonConfig msg -> ButtonContent -> Html msg

A delightful button which can trigger an effect when clicked!

This button will trigger the passed-in message if the button state is:

  • Enabled
  • Unfulfilled

This button will be Disabled if the button state is:

  • Disabled
  • Error
  • Loading
  • Success