Functions for generating input components with labels and input elements.
:error
: Error message for the field. Defaults to error for field in
current scope..:hint
: Hint for the field. Defaults to nil.:input-html
: HTML attributes for the input element. Defaults to {}
.:label
: Label text. Defaults to translation.:label-html
: HTML attributes for the label element. Defaults to {}
.:value
: Value for the field. Defaults to value for field in current scope.:wrapper-html
: HTML attributes for the wrapper element. Defaults to {}
.Functions for generating input components with labels and input elements. ### Options for inputs * `:error`: Error message for the field. Defaults to error for field in current scope.. * `:hint`: Hint for the field. Defaults to nil. * `:input-html`: HTML attributes for the input element. Defaults to `{}`. * `:label`: Label text. Defaults to translation. * `:label-html`: HTML attributes for the label element. Defaults to `{}`. * `:value`: Value for the field. Defaults to value for field in current scope. * `:wrapper-html`: HTML attributes for the wrapper element. Defaults to `{}`.
(check-box-group-input field options)
(check-box-group-input field options args)
Returns a group of checkboxes inside a labeled wrapper.
(check-box-group-input :hobbies [["webdev" "Web Development"]
["spelunking" "Spelunking"]])
Returns a group of checkboxes inside a labeled wrapper. ### Example (check-box-group-input :hobbies [["webdev" "Web Development"] ["spelunking" "Spelunking"]])
(check-box-input field)
(check-box-input field args)
Returns a check box inside a labeled wrapper.
(check-box-input :privacy-policy {:error "Must be accepted"})
Returns a check box inside a labeled wrapper. ### Example (check-box-input :privacy-policy {:error "Must be accepted"})
(drop-down-input field options)
(drop-down-input field options args)
Returns a drop down inside a labeled wrapper.
(drop-down-input :language ["Finnish" "English"]
{:value "Finnish"})
Returns a drop down inside a labeled wrapper. ### Example (drop-down-input :language ["Finnish" "English"] {:value "Finnish"})
(email-field-input field)
(email-field-input field args)
Returns an email field inside a labeled wrapper.
(email-field-input :email {:label "Username"})
Returns an email field inside a labeled wrapper. ### Example (email-field-input :email {:label "Username"})
(file-upload-input field)
(file-upload-input field args)
Returns a file upload field inside a labeled wrapper.
(file-upload-input :avatar {:input-html {:data-max-size "2M"}})
Returns a file upload field inside a labeled wrapper. ### Example (file-upload-input :avatar {:input-html {:data-max-size "2M"}})
(input field)
(input field input-or-args & inputs)
Returns the input element(s) inside a labeled wrapper. Use for creating your own input functions.
(defn uneditable-input [field {:keys [value] :as args}]
(input field args
(str "<span class=\"uneditable-input\">"
value "</span>")))
Returns the input element(s) inside a labeled wrapper. Use for creating your own input functions. ### Example (defn uneditable-input [field {:keys [value] :as args}] (input field args (str "<span class=\"uneditable-input\">" value "</span>")))
(password-field-input field)
(password-field-input field args)
Returns a password field inside a labeled wrapper.
(password-field-input :password {:input-html {:class "password"}})
Returns a password field inside a labeled wrapper. ### Example (password-field-input :password {:input-html {:class "password"}})
(radio-button-group-input field options)
(radio-button-group-input field options args)
Returns a group of radio buttons inside a labeled wrapper.
(radio-button-group-input :language ["Finnish" "English"])
Returns a group of radio buttons inside a labeled wrapper. ### Example (radio-button-group-input :language ["Finnish" "English"])
(text-area-input field)
(text-area-input field args)
Returns a text area inside a labeled wrapper.
(text-area-input :bio {:hint "Tell people about your background."})
Returns a text area inside a labeled wrapper. ### Example (text-area-input :bio {:hint "Tell people about your background."})
(text-field-input field)
(text-field-input field args)
Returns a text field inside a labeled wrapper.
(text-field-input :name {:input-html {:placeholder "First :Last"}})
Returns a text field inside a labeled wrapper. ### Example (text-field-input :name {:input-html {:placeholder "First :Last"}})
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close