mbr/elm-chadcn/1.0.0

ChadCn.Button

Provides a button component.

The implementation follows the shadcn Base UI structure and Nova defaults.

type Config msg

Describes a button and its presentation.

= Button
| Reset
| Submit

Describes native button behavior.

type Size
= ExtraSmall
| Small
| Medium
| Large
| Icon
| ExtraSmallIcon
| SmallIcon
| LargeIcon

Describes button size.

type Variant
= Default
| Destructive
| Outline
| Secondary
| Ghost
| Link

Describes button appearance.

new : List (Html msg) -> Config msg

Creates a default button with caller-owned content.

withAttributes : List (Attribute msg) -> Config msg -> Config msg

Adds native attributes to the button.

withDisabled : Bool -> Config msg -> Config msg

Sets whether the button is disabled.

withOnClick : msg -> Config msg -> Config msg

Sets the message emitted when the button is clicked.

withSize : Size -> Config msg -> Config msg

Sets the button size.

Sets the native button behavior.

Sets the button appearance.

view : Config msg -> Html msg

Renders a configured button.

Applies input-group button defaults.