rundis / elm-bootstrap / Bootstrap.Form.Fieldset

Fieldset is a handy block level element you can use to group form elements. Fieldset comes with the added benefit of disabling all child controls when we set it's disabled attribute.

General


type Config msg

Opaque representation of the view configuration for a fieldset.

view : Config msg -> Html msg

View a fieldset standalone. To create a fieldset you start off with a basic configuration which you can compose of several optional elements.

Fieldset.config
    |> Fieldset.asGroup
    |> Fieldset.legend [] [ text "Radio buttons" ]
    |> Fieldset.children
        (Radio.radioList "myradios"
            [ Radio.create [] "Option one"
            , Radio.create [] "Option two"
            , Radio.create [ Radio.disabled True ] "I'm disabled"
            ]
        )
    |> Fieldset.view

config : Config msg

Create default config for a fieldset

Customization

asGroup : Config msg -> Config msg

Make the fieldset a field group

disabled : Basics.Bool -> Config msg -> Config msg

Disable a fieldset

children : List (Html msg) -> Config msg -> Config msg

legend : List (Html.Attribute msg) -> List (Html msg) -> Config msg -> Config msg

Provide a legend for a set of fields

attrs : List (Html.Attribute msg) -> Config msg -> Config msg

When you need to customize a fieldset with standard Html.Attribute attributes use this function