NoRedInk/noredink-ui/12.6.1

NOTE: the latest version is 35.9.3

Nri.Ui.RadioButton.V1

Changes from monolith version:

- uses Nri.Ui.Data.PremiumLevel rather than monolith version
- uses Nri.Ui.Html.* rather than deprecated monolith extras
- removes Role.radio from the radio input's label
{ label : String
, value : a
, name : String
, selectedValue : Maybe a
, onSelect : a -> msg
, showLabel : Bool
, noOpMsg : msg
, valueToString : a -> String
}
-> Html msg

View a single radio button. If used in a group, all radio buttons in the group should have the same name attribute.

{ label : String
, value : a
, name : String
, selectedValue : Maybe a
, teacherPremiumLevel : PremiumLevel
, contentPremiumLevel : PremiumLevel
, onSelect : a -> msg
, premiumMsg : msg
, noOpMsg : msg
, valueToString : a -> String
, showPennant : Bool
, isDisabled : Bool
}
-> Html msg

A radio button that should be used for premium content.

This radio button is locked when the premium level of the content is greater than the premium level of the teacher.

  • onChange: A message for when the user selected the radio button
  • onLockedClick: A message for when the user clicks a radio button they don't have PremiumLevel for. If you get this message, you should show an Nri.Premium.Model.view