primait/pyxis-components/7.1.0

NOTE: the latest version is 9.0.3

Prima.Pyxis.ButtonGroup

Configuration

type Config msg

Represent the configuration of the buttonGroup.

Configuration Methods

create : List (Config msg) -> Config msg

Create a button group.

--




import Prima.Pyxis.ButtonGroup as ButtonGroup


myBtnGroup : ButtonGroup.Config Msg
myBtnGroup =
    ButtonGroup.configure myButtons

Rendering

render : Config msg -> Html msg

Create a button wrapper which can hold a set of Buttons.

--


import Prima.Pyxis.Button as Button
import Prima.Pyxis.ButtonGroup as Group


type Msg =
    Clicked


...


ctaBtn : Button.Config Msg
ctaBtn =
    Button.callOut "Click me!"
        |> Button.withOnClick Clicked
        |> Button.withDisabled True




primaryBtn : Button.Config Msg
primaryBtn =
    Button.primary "Click me!"
        |> Button.withOnClick Clicked


...


buttonGroup : ButtonGroup.Config Msg
buttonGroup =
    ButtonGroup.centered [ctaBtn, primaryBtn]
        |> ButtonGroup.withId "group-1"


...


view : Html Msg
view =
    ButtonGroup.render buttonGroup

Options

withAttribute : Attribute msg -> Config msg -> Config msg

Adds a generic attribute to the ButtonGroup.

Adds an alignment class to the ButtonGroup.

Adds an alignment class to the ButtonGroup.

Adds an alignment class to the ButtonGroup.

Adds an alignment class to the ButtonGroup.

Adds an alignment class to the ButtonGroup.

Adds an alignment class to the ButtonGroup.

Adds an alignment class to the ButtonGroup.

withClass : String -> Config msg -> Config msg

Adds a class to the ButtonGroup.

withId : String -> Config msg -> Config msg

Adds an id Html.Attribute to the ButtonGroup.