UI.Spinner

UI component for a loading spinner.

See UI.Spinner.Variant for the different types of spinners available.

To include a spinner in your view:

  • Initialize a spinner variant with init.
  • Render the spinner with view.
  • Subscribe to the spinner's events to keep it updated.

See the spinner examples in the repo's example folder for full usage examples.

type Spinner
init : Variant -> Spinner

Initialize a spinner Variant.

view : Spinner -> Element

Render a spinner in your view.

update : Spinner -> Spinner

Update a spinner.

Normally you would call this in your update function when you receive the message you passed to subscribe.

subscribe : msg -> Spinner -> Sub msg

Subscribe to spinner events so you can keep it updated with update.

toString : Spinner -> String

Get the current frame of a spinner as a String.

Normally you shouldn't need this function, but don't let me stop you from doing something weird and cool.