carboncloud / ui-library / Ui.Button

Defines a Button component

Types


type ButtonColor
    = Primary
    | Secondary
    | Warn
    | Neutral

Defines the available button colors


type ButtonEmphasis
    = High
    | Mid
    | Low

Defines the emphasis of the button


type ButtonContent
    = Text String
    | TextWithLeftIcon String Ui.Icon.Icon
    | TextWithRightIcon String Ui.Icon.Icon

Defines the content of the button

Views

view : { onClick : Maybe msg, color : ButtonColor, emphasis : ButtonEmphasis } -> ButtonContent -> Html.Styled.Html msg

Returns a view of a button This should be used whenever possible. You can use customView if you need to customize the button.

customView : List Css.Style -> List (Html.Styled.Attribute msg) -> { onClick : Maybe msg, color : ButtonColor, emphasis : ButtonEmphasis } -> ButtonContent -> Html.Styled.Html msg

Returns a custom view of a button.

iconButton : List (Html.Styled.Attribute msg) -> { onClick : Maybe msg, icon : Ui.Icon.Icon, tooltip : String } -> Accessibility.Styled.Html msg

A view of an icon button which can be useful when we have little space