This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.

ClarityUI.Subnav

Clarity Header Subnav

For more documenation on the clarity subnav : https://vmware.github.io/clarity/documentation/header#subnav

Usage

subnav : List NavItem -> Html msg

Main subnav entry point.

Takes a list of NavItems and renders out a subnav compatible ul

Data

type alias NavItem = { link : String , text : String }

NavItem

Describes A single nav element.

module ClarityUI.Subnav exposing (subnav, NavItem)

{-| Clarity Header Subnav

For more documenation on the clarity subnav : <https://vmware.github.io/clarity/documentation/header#subnav>


# Usage

@docs subnav


# Data

@docs NavItem

-}

import Html exposing (Html, ul, li)
import Html.Attributes exposing (class, href)


{-| NavItem

Describes A single nav element.

-}
type alias NavItem =
    { link : String
    , text : String
    }


{-| Main subnav entry point.

Takes a list of NavItems and renders out a subnav compatible ul

-}
subnav : List NavItem -> Html msg
subnav navItems =
    ul [ class "nav" ] <|
        List.map
            (\item ->
                li [ class "nav-link", href item.link ] [ Html.text item.text ]
            )
            navItems