Rerouted (regenerated, verified). Same repository and tag, but GitHub now builds the zip with different bytes, so it no longer matches the SHA-1 package.elm-lang.org recorded. The Lamdera package server serves a copy recovered from https://github.com/aforemny/material-components-web-elm.
What we checked: Tag 6.0.0 is still on github.com/aforemny/material-components-web-elm; its commit fa5f16f0eddc is from 2020-10-08 13:01 UTC, before the version was published (2020-10-08 13:03 UTC); every file Elm uses matches a copy in a Lamdera package cache from 2021-02-13, from before the change; elm.json is byte-identical to package.elm-lang.org's; the exposed modules match docs.json; the zip's SHA-1 is not the published one (GitHub's zip no longer comes out byte for byte the same), so the contents were checked instead.
The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.
Details · package.elm-lang.org's zip: https://github.com/aforemny/material-components-web-elm/zipball/6.0.0/
Tabs organize and allow navigation between groups of content that are related and at the same level of hierarchy. The tab bar contains the tab components.
This module concerns the tab bar container. If you are looking for the tab item, refer to Material.Tab.
import Material.Tab as Tab
import Material.TabBar as TabBar
type Msg
= TabClicked Int
main =
TabBar.tabBar TabBar.config
[ Tab.tab
(Tab.config
|> Tab.setActive True
|> Tab.setOnClick (TabClicked 0)
)
{ label = "Tab 1", icon = Nothing }
, Tab.tab
(Tab.config |> Tab.setOnClick (TabClicked 1))
{ label = "Tab 2", icon = Nothing }
]Specify a tab bar's tabs to be stacked
Stacked tabs display their icon below the their label.
Specify whether a tab bar's tabs should be of minimum width
Usually, a tab bar's tabs have a minimum with. Using this option, tabs are as narrow as possible.
Specify whether a tab bar's tab indicator spans its content
Usually, a tab bar's tab indicator spans the entire tab. Use this option to make it span only it's label instead.
Specify tab bar's alignment of tabs in case they overflow horizontally
Specify additional attribtues
In a stacked tab bar, the label and icon of a tab flow vertically instead of
horizontally. To make a tab bar stacked, set its setStacked configuration
option to True.
Tabs within a stacked tab bar should specify both a label and an icon.
TabBar.tabBar (TabBar.config |> TabBar.setStacked True) []Tabs by defauls span a minimum width. If you want tabs to be as narrow as
possible, set the tab bar's setMinWidth configuration option to True.
TabBar.tabBar (TabBar.config |> TabBar.setMinWidth True) []The tab's active indicator by default spans the entire tab. If you want active
indicators to only span their tab's content, set the tab bar's
setIndicatorSpansContent configuration option to True.
TabBar.tabBar
(TabBar.config |> TabBar.setIndicatorSpansContent True)
[]The tab bar supports tabs overflowing its width and will enable scrolling in that case. You may change the alignment of the elements inside the scroll content.
Alignment of a tab scroller
TabBar.tabBar
(TabBar.config |> TabBar.setAlign (Just TabBar.Center))
[]You may programatically focus a tab bar by assigning an id attribute to it and
use Browser.Dom.focus.
TabBar.tabBar
(TabBar.config
|> TabBar.setAttributes
[ Html.Attributes.id "my-tabs" ]
)
[]
Configuration of a tab bar