PaackEng/paack-ui/6.5.0

NOTE: the latest version is 7.23.0

UI.SummaryListItem

SummaryListItem represents a single item in a list that is usually selectable or searchable. This component is meant to be used with ListView.

import UI.SummaryListItem as Summary


listItemView : AppConfig -> Bool -> Item -> Element Msg
listItemView appConfig isSelected item =
    Summary.view appConfig.renderConfig
        isSelected
        item.name
        item.subtitle
        (Badge.grayLight "badge")


listView : AppConfig -> Model -> ListView Item Msg
listView appConfig model =
    listItemView appConfig
        |> ListView.selectList Msg.Select Item.id
        |> ListView.withSearchField (searchField appConfig model)
        |> ListView.withActionBar (actionBar appConfig)
        |> ListView.withDomId "item-list"

Rendering

view : RenderConfig -> Bool -> String -> String -> Badge -> Element msg

This component does not use a builder pattern so this is the only way to render it. The isSelected param alters its colors for contrast