jjagielka/select-menu/1.0.1

Menu

Make Dropdown and FocusList work together.

Types

type alias Item msg =
Item msg

Menu item type.

type Msg

Internal select/menu messages.

TEA

init : String -> Menu

Initialize a menu object. As the browser focus is used, menu requires unique identifier.

update : Msg -> Menu -> ( Menu, Cmd Msg )

Standard elm update.

view : Menu -> List (Attribute Msg) -> List (Item Msg) -> Html Msg

Renders the menu. Attributes are used to style the dropdown container. Second parameter is an arbitrary list of menut Item's.

Items

button : String -> List (Attribute msg) -> List (Html msg) -> Item msg

Button like menu. Use it when you need select mode - no url redirection but value collection. This is used with onSelect attributes.

Events

Changes the menu state to Open

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

Menu control. Add that set of attributes to the element controling the menu: button, input, ...

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

Menu selection catching. Add this as a Html.Attribute to the container carring the menu.