primait/pyxis-components/8.0.0

NOTE: the latest version is 9.0.3

Prima.Pyxis.DownloadButton

Configuration

type Config msg

Represent the configuration of the DownloadButton.

Configuration Methods

download : String -> String -> Config msg

Create a default download button.

Rendering

render : Config msg -> Html msg

Renders the button by receiving it's configuration.

--


import Prima.Pyxis.DownloadButton as DownloadButtonButton


type Msg =
    Clicked


...


myBtn : DownloadButton.Config Msg
myBtn =
    DownloadButton.default "Certificato di polizza" "Scarica .pdf"
        |> DownloadButton.withDisabled False
        |> DownloadButton.withOnClick Clicked


...


view : Html Msg
view =
    DownloadButton.render myBtn

Options

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

Adds a generic attribute to the Button.

withClass : String -> Config msg -> Config msg

Adds classes to the classes of the DownloadButton.

withDisabled : Bool -> Config msg -> Config msg

Adds a disabled Html.Attribute to the DownloadButton.

withId : String -> Config msg -> Config msg

Adds an id Html.Attribute to the DownloadButton.

withTabIndex : Int -> Config msg -> Config msg

Adds a tabIndex Html.Attribute to the DownloadButton.

Adds a target Html.Attribute to the DownloadButton.

Adds a target Html.Attribute to the DownloadButton.

Adds a target Html.Attribute to the DownloadButton.

Adds a target Html.Attribute to the DownloadButton.

withTitle : String -> Config msg -> Config msg

Adds a title Html.Attribute to the DownloadButton.

Tells the DownloadButton component to use SVG icons instead of Pyxis icons.

Event Options

withOnClick : msg -> Config msg -> Config msg

Adds an onClick Html.Event to the DownloadButton.

withOnMouseDown : msg -> Config msg -> Config msg

Adds an onMouseDown Html.Event to the DownloadButton.

withOnMouseUp : msg -> Config msg -> Config msg

Adds an onMouseUp Html.Event to the DownloadButton.

withOnMouseEnter : msg -> Config msg -> Config msg

Adds an onMouseEnter Html.Event to the DownloadButton.

withOnMouseLeave : msg -> Config msg -> Config msg

Adds an onMouseLeave Html.Event to the DownloadButton.

withOnMouseOver : msg -> Config msg -> Config msg

Adds an onMouseOver Html.Event to the DownloadButton.

withOnMouseOut : msg -> Config msg -> Config msg

Adds an onMouseOut Html.Event to the DownloadButton.