arowM / elm-neat-layout / Neat.Flow

Module for flow contents.

You will use this module for two main purposes:

Core


type alias Flow msg =
Neat.Internal.Flow msg

Representing a text.

map : (a -> b) -> Flow a -> Flow b

Primitive constructors

fromString : String -> Flow msg

Generate a Flow with given text content.

Attributes

setMixin : Mixin msg -> Flow msg -> Flow msg

setMixins : List (Mixin msg) -> Flow msg -> Flow msg

setAttribute : Html.Attribute msg -> Flow msg -> Flow msg

setAttributes : List (Html.Attribute msg) -> Flow msg -> Flow msg

setClass : String -> Flow msg -> Flow msg

Append class attribute.

setId : String -> Flow msg -> Flow msg

Append id attribute.

WAI-ARIA

setRole : String -> Flow msg -> Flow msg

Set "role" value for WAI-ARIA.

setAria : String -> String -> Flow msg -> Flow msg

Set "aria-*" value for WAI-ARIA.

e.g., setAria "required" "true" stands for "aria-required" is "true".

setBoolAria : String -> Basics.Bool -> Flow msg -> Flow msg

Set boolean "aria-*" value for WAI-ARIA.

i.e.,

Handle conditions

none : Flow msg

Generate Nothing. It can be used to realize Flows only displayed under certain conditions, as shown below.

fromFlows
    [ case mtext of
        Just t ->
            text t

        Nothing ->
            none
    ]

In most cases, however, a function like when will suffice.

when : Basics.Bool -> Flow msg -> Flow msg

unless : Basics.Bool -> Flow msg -> Flow msg

withMaybe : Maybe a -> (a -> Flow msg) -> Flow msg

Lower level functions for HTML

setNodeName : String -> Flow msg -> Flow msg