primait / pyxis-components / Prima.Pyxis.ButtonGroup

Configuration


type Config msg

Represent the configuration of the buttonGroup.

Configuration Methods

create : List (Prima.Pyxis.Button.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 : Html.Attribute msg -> Config msg -> Config msg

Adds a generic attribute to the ButtonGroup.

withAlignmentCentered : Config msg -> Config msg

Adds an alignment class to the ButtonGroup.

withAlignmentContentEnd : Config msg -> Config msg

Adds an alignment class to the ButtonGroup.

withAlignmentContentStart : Config msg -> Config msg

Adds an alignment class to the ButtonGroup.

withAlignmentCoverFluid : Config msg -> Config msg

Adds an alignment class to the ButtonGroup.

withAlignmentSpaceAround : Config msg -> Config msg

Adds an alignment class to the ButtonGroup.

withAlignmentSpaceBetween : Config msg -> Config msg

Adds an alignment class to the ButtonGroup.

withAlignmentSpaceEvenly : Config msg -> Config msg

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.