supermacro / elm-antd / Ant.Menu

Primitives for creating Menus.

This module comes with three big menu primitives:

The overarching idea in this module is that you start with the inner items of your menu, constructing it piece by piece, until you have all of the elements of the Menu. Once that is done, then you can create your Menu and turn it into Html msg.

A good example can be found in this project's showcase.

initMenuItem : msg -> Html msg -> MenuItem msg

Given a msg and some contents, create a menu item

selected : MenuItem msg -> MenuItem msg

Mark the menu item as selected

initMenu : Menu msg

Initialize a menu with no content. This is useful when constructing your menu using folds.

initSubMenu : SubMenu msg

Create an empty nested menu

initItemGroup : ItemGroupTitle -> List (MenuItem msg) -> ItemGroup msg

Initialize a item group with a set of associated MenuItem's

pushItem : MenuItem msg -> Menu msg -> Menu msg

push a menu item to the end of the menu

pushSubMenu : SubMenu msg -> Menu msg -> Menu msg

push a SubMenu to the end of the menu

pushItemGroup : ItemGroup msg -> Menu msg -> Menu msg

push a item group to the end of the menu

pushItemToSubMenu : MenuItem msg -> SubMenu msg -> SubMenu msg

Push a MenuItem to the end of the SubMenu

pushItemGroupToSubMenu : ItemGroup msg -> SubMenu msg -> SubMenu msg

Push a Item Group to the end of the SubMenu

pushSubMenuToSubMenu : SubMenu msg -> SubMenu msg -> SubMenu msg

Push a SubMenu to the end of the SubMenu

pushItemToItemGroup : MenuItem msg -> ItemGroup msg -> ItemGroup msg

Add a MenuItem to the end of the ItemGroup

toHtml : Menu msg -> Html msg

Turn your Menu into a Html msg


type Menu msg

Represents a Menu, its configuration and the Menu's content


type SubMenu msg

Represents a sub-menu, and the submenu's associated configuration / state, as well as the menu's contents


type ItemGroup msg

Represents a grouping of MenuItems


type MenuMode
    = Vertical
    | Horizontal
    | Inline

This type defines how the menu will be positioned