defmodule Materialize.Components.Navbar do @moduledoc """ Use module for generate HTML block navbar. Add alias in **/web/views/layout_view.ex** with configuration navbar: ```Elixir alias #{__MODULE__} def navbar do [items: [ [tag: "a", text: "Logo", attr: [href: "#", class: "brand-logo"]], [tag: "ul", attr: [id: "nav-mobile", class: "right hide-on-med-and-down"], items: [ [tag: "a", text: "list 1", attr: [href: "#1"]], [tag: "a", text: "list 2", attr: [href: "#2"]] ]] ]] |> Navbar.get_html() end ``` Use navbar in templates: ```Elixir <%= navbar %> ``` Result ```Html
``` """ alias Materialize.Html @wrapper_options [attr: [class: "nav-wrapper"]] @logo_options [attr: [href: "#", class: "brand-logo"]] @ul_options [attr: [id: "nav-mobile", class: "right hide-on-med-and-down"]] @doc """ Create tag **span** or etc. ### Parameters - options: keyword list ### Example ```Elixie #{__MODULE__}.get_html([items: [ [tag: "a", text: "Logo", attr: [href: "#", class: "brand-logo"]], [tag: "ul", attr: [id: "nav-mobile", class: "right hide-on-med-and-down"], items: [ [tag: "a", text: "list 1", attr: [href: "#1"]], [tag: "a", text: "list 2", attr: [href: "#2"]] ]] ]]) ``` """ @spec get_html(Keyword.t) :: List.t def get_html(options) do options = check_options options attr = Html.get_attribute options [start: "