mc706/prefab-ui/3.0.1

NOTE: the latest version is 5.1.0

Prefab.Button

Button Module

Closely modeled after the Clarity Design System's button component. https://clarity.design/documentation/button

Options

type Size
= Normal
| Small
| Large
| Block

Change the Size of the button

type Style
= Primary
| Secondary
| Success
| Danger
| Warning
| Info

Change the Style of the button

type Variant
= Solid
| Outline
| Flat

Change the Variant of the button

Button

new :
{ label : String
, onClick : Maybe msg
}
-> Button msg

Create a new button with a label and an optional onClick message

view : List (Attribute msg) -> Button msg -> Element msg

View the button

Adding Options

withDisable : Button msg -> Button msg

Disable the button

withIconLeft : Icon msg -> Button msg -> Button msg

Add an icon to the left of the button

withIconRight : Icon msg -> Button msg -> Button msg

Add an icon to the right of the button

withSize : Size -> Button msg -> Button msg

Change the Size of the button

withStyle : Style -> Button msg -> Button msg

Change the Style of the button

withVariant : Variant -> Button msg -> Button msg

Change the Variant of the button