intrepidshape/elm-web3-ui/4.0.0

Web3.Ui.StatCell

Single label/value cell with optional delta and sentiment color. The unit-of-display analytics row that every dapp reaches for: "TVL", "24h volume", "stakers", "floor".

Web3.Ui.StatCell.view []
    { label = "Floor price"
    , value = "0.024 PLS"
    , delta = Just "+1.4%"
    , sentiment = Web3.Ui.StatCell.Positive
    }

CSS classes: web3-statcell, web3-statcell__label, web3-statcell__value, web3-statcell__delta, web3-statcell--positive / --negative / --neutral.

view : List (Attribute msg) -> Config -> Html msg

Render the stat cell.

type alias Config =
{ label : String
, value : String
, delta : Maybe String
, sentiment : Sentiment
}

The label, the number, and an optional delta with the sentiment that colors it. Both strings are pre-formatted by the caller.

= Positive
| Negative
| Neutral