NoRedInk/noredink-ui/13.0.1

NOTE: the latest version is 35.9.3

Nri.Ui.RadioButton.V2

Changes from V1:

  • adds an outline when a radio button is focused
  • remove NoOp/event swallowing (it broke default radio button behavior)
{ label : String
, value : a
, name : String
, selectedValue : Maybe a
, onSelect : a -> 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
, 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