bigardone/elm-css-placeholders/1.0.0

NOTE: the latest version is 2.0.1

Placeholders.Block

Renders a text block placeholder.

Definition

type alias Block =
{ backgroundColor : Color
, height : Px
, items : List Int
}

Represents the configuration for a text block placeholder. It has the following attributes:

  • backgroundColor: takes a Css.Color and represents the background color of the lines.
  • height: takes a Css.Px and represents the height of the lines.
  • items: a list of integers which is used to randomize the number of lines.
default : Block

Returns a default configuration for a block placeholder.

withItems : List Int -> Block -> Block

Adds items to a Block.

init : Block -> ( Block, Cmd Msg )

Inits a block placeholder shuffling its items.

Update

type Msg

Block msg.

update : Msg -> Block -> ( Block, Cmd Msg )

Block update.

View

view : Block -> Html msg

Renders a block placeholder using the given configuration.