mbr/elm-chadcn/1.0.0

ChadCn.Input

Provides an input component.

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

type Config msg

Describes an input and its behavior.

= Email
| File
| Number
| Password
| Search
| Text
| Url

Describes the data accepted by an input.

new : Config msg

Creates an uncontrolled text input.

withAriaLabel : String -> Config msg -> Config msg

Sets the input's accessible label.

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

Adds native attributes to the input.

withAutocomplete : Bool -> Config msg -> Config msg

Sets whether the browser may autocomplete the input.

withDisabled : Bool -> Config msg -> Config msg

Sets whether the input is disabled.

withInvalid : Bool -> Config msg -> Config msg

Sets whether the input is invalid.

withOnInput : (String -> msg) -> Config msg -> Config msg

Sets the message created when the input value changes.

withPlaceholder : String -> Config msg -> Config msg

Sets the input placeholder.

Sets the accepted input data type.

withValue : String -> Config msg -> Config msg

Sets the controlled input value.

view : Config msg -> Html msg

Renders a configured input.

Applies input-group control defaults.