jjagielka/select-menu/1.0.1

Menu.FocusList

Manage focus changes through the list of sibilings.

Types

type alias FocusList =
String

The only value needed to be stored is the unique identifier used to set focus.

type Item msg
= Anchor ( String, List (Attribute msg), List (Html msg) )
| Button ( String, List (Attribute msg), List (Html msg) )

List item types. Html link or button.

type Msg

Internal module messages.

TEA

update : Msg -> FocusList -> Cmd Msg

Standard update function.

view : FocusList -> List (Item msg) -> List (Html msg)

Renders the list.

Events

trigger : (Msg -> msg) -> Attribute msg

Html.Attribute that causes the selection of the first elment in the list.

onSelect : (String -> msg) -> FocusList -> Attribute msg

Catches the selection.

onKeyDown : String -> (Msg -> msg) -> Attribute msg

Html.Attribute to handle navigation keys.

div [ onKeyDown FocusListMsg ]
    [ FocusList.view list children
    ]