A simple five star rating component. Uses unicode star characters ★ & ☆ (U+2605 & U+2606) by default. Allows for custom Html elements to be used.
Initial rating state. Sets rating to zero. Uses html passed in by user.
Render the component. Accepts a name for the rating component, a list of css class names and a Rating.State. The radioGroupName is used to populate the name parameter on the radio buttons, so use a unique name for each star rating on the same page. If using initialState to initialize this component, it uses text characters to display the stars, so use css accordingly.
Rating.classView "starRating" [ "cssClass1", "cssClass2" ] ratingStateRender the component. Accepts a name for the rating component, a list of style tuples and a Rating.State. The radioGroupName is used to populate the name parameter on the radio buttons, so use a unique name for each star rating on the same page. If using initialState to initialize this component, it uses text characters to display the stars, so use css accordingly.
Rating.styleView "starRating" [ ( "color", "red" ) ] ratingStateUpdate the state of the rating component.
RatingMsg msg ->
( { model | ratingState = (Rating.update msg model.ratingState) }, Cmd.none )Opaque type obscuring rating model.
Opaque type obscuring rating messages.
Initial rating state. Sets rating to zero. Uses "★" and "☆".