uncover-co/elm-widgets/2.27.0

NOTE: the latest version is 2.28.0

W.Table

view : List (Attribute msg a) -> List (Column msg a) -> List a -> Html msg

Columns

List (ColumnAttribute msg a)
-> { label : String
, content : a -> Html msg
}
-> Column msg a
List (ColumnAttribute msg a)
-> { label : String
, value : a -> String
}
-> Column msg a
int :
List (ColumnAttribute msg a)
-> { label : String
, value : a -> Int
}
-> Column msg a
List (ColumnAttribute msg a)
-> { label : String
, value : a -> Float
}
-> Column msg a
List (ColumnAttribute msg a)
-> { label : String
, value : a -> Bool
}
-> Column msg a
type Column msg a

Column Attributes

customLabel : List (Html msg) -> ColumnAttribute msg a
labelClass : String -> ColumnAttribute msg a

Pass in extra classes for a column label. This can be useful for when you want to conditionally hide sorting icons unless the user is hovering a table header.

An example using tailwindcss:

W.Table.string
    [ W.Table.labelClass "group"
    , W.Table.labelRight
        [ div
            [ class "opacity-0 group-hover:opacity-100" ]
            [ .. ]
        ]
    ]
    { .. }
labelLeft : List (Html msg) -> ColumnAttribute msg a
labelRight : List (Html msg) -> ColumnAttribute msg a
width : Int -> ColumnAttribute msg a
columnHtmlAttrs : List (Attribute msg) -> ColumnAttribute msg a
type ColumnAttribute msg a

Actions

onClick : (a -> msg) -> Attribute msg a
onMouseEnter : (a -> msg) -> Attribute msg a
onMouseLeave : msg -> Attribute msg a

Groups

groupBy : (a -> String) -> Attribute msg a
groupValue : (String -> List a -> Html msg) -> ColumnAttribute msg a
groupValueCustom : (a -> List a -> Html msg) -> ColumnAttribute msg a
groupSortBy : (a -> String -> comparable) -> Attribute msg a
groupSortByDesc : (a -> String -> comparable) -> Attribute msg a
(( String, a, List a ) -> ( String, a, List a ) -> Order)
-> Attribute msg a
groupCollapsed : (a -> String -> Bool) -> Attribute msg a
onGroupClick : (a -> msg) -> Attribute msg a
onGroupMouseEnter : (a -> msg) -> Attribute msg a

Table Attributes

highlight : (a -> Bool) -> Attribute msg a

Html

htmlAttrs : List (Attribute msg) -> Attribute msg a
type Attribute msg a