orus-io/elm-orus-ui/1.0.0

NOTE: the latest version is 1.0.1

Formerly cdevienne/elm-orus-ui. Search finds this package by either name.

OUI.Tabs

A tabs component that implement the material specs : https://m3.material.io/components/tabs/overview

Types

type Type
= Primary
| Secondary

The tabs types

type Tabs key item msg

A tabs component

Constructors

new : (item -> String) -> (key -> msg) -> Tabs key item msg

Creates a new Tabs

withType : Type -> Tabs key item msg -> Tabs key item msg

Change the tabs type

secondary : Tabs key item msg -> Tabs key item msg

Change the tabs type to "Secondary"

withIcon : (item -> Maybe Icon) -> Tabs key item msg -> Tabs key item msg

Add an icon extractor

withBadge : (item -> Maybe Badge) -> Tabs key item msg -> Tabs key item msg

Add a badge extractor

withItems : List ( key, item ) -> Tabs key item msg -> Tabs key item msg

Set the items

withSelected : key -> Tabs key item msg -> Tabs key item msg

Set the selected item

internals

getColor : Tabs key item msg -> Color

get the color

getItemToBadge : Tabs key item msg -> item -> Maybe Badge

get the itemToBadge function

getItemToIcon : Tabs key item msg -> item -> Maybe Icon

get the itemToIcon function

getItemToText : Tabs key item msg -> item -> String

get the itemToText function

getItems : Tabs key item msg -> List ( key, item )

get the items

getOnClick : Tabs key item msg -> key -> msg

get the 'on click' message

getSelected : Tabs key item msg -> Maybe key

get the selected key

getType : Tabs key item msg -> Type

get the type