betagouv/elm-dsfr/3.0.0

NOTE: the latest version is 5.2.0

BetaGouv.DSFR.Input

Création

new :
{ value : String
, onInput : String -> msg
, label : Html Never
, name : String
}
-> InputConfig msg

Crée un champ de saisie

Input.new
    { value = date
    , onInput = UpdateDate
    , label = text "Date"
    , name = "date"
    }
    |> Input.date
    |> Input.view
view : InputConfig msg -> Html msg

Types de champ de saisie

textArea : Maybe Int -> InputConfig msg -> InputConfig msg

Affiche un textarea

Input.new
    { value = value
    , onInput = UpdateComment
    , label = text "Commentaire"
    , name = "commentaire"
    }
    |> Input.textArea (Just 8)
    |> Input.withExtraAttrs [ class "w-full" ]
    |> Input.view
date : InputConfig msg -> InputConfig msg
email : InputConfig msg -> InputConfig msg
number : InputConfig msg -> InputConfig msg
password : InputConfig msg -> InputConfig msg
textDisplay : InputConfig msg -> InputConfig msg
text : InputConfig msg -> InputConfig msg

Configuration

withDisabled : Bool -> InputConfig msg -> InputConfig msg
withValid : Maybe (List (Html msg)) -> InputConfig msg -> InputConfig msg
withError : Maybe (List (Html msg)) -> InputConfig msg -> InputConfig msg
withExtraAttrs : List (Attribute Never) -> InputConfig msg -> InputConfig msg
withHint : List (Html Never) -> InputConfig msg -> InputConfig msg
withReadonly : Bool -> InputConfig msg -> InputConfig msg
withType : InputType -> InputConfig msg -> InputConfig msg
withIcon : Maybe String -> InputConfig msg -> InputConfig msg